:root {
  --ink: #2b1d1a;
  --cream: #fff6e0;
  --red: #d63c2f;
  --yellow: #f4c430;
  --blue: #3b7dd8;
  --green: #3fa34d;
  --purple: #8a4fd8;
  --grey: #e9e2d0;
}

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #5fb8f5;
  color: var(--ink);
  font-family: 'Fredoka', 'Trebuchet MS', 'Arial Rounded MT Bold', system-ui, sans-serif;
  font-weight: 500;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
body { position: fixed; inset: 0; }
img { image-rendering: pixelated; -webkit-user-drag: none; }

#scene {
  position: absolute;
  left: 0;
  top: 0;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
#floats, #ui, #modal { position: absolute; inset: 0; }
#floats { pointer-events: none; z-index: 3; }
#ui { z-index: 2; }
#modal { z-index: 5; display: none; align-items: center; justify-content: center; background: rgba(20, 12, 8, 0.45); }
#modal.show { display: flex; }

/* ---------- Tombol ---------- */
.btn {
  font: inherit;
  font-weight: 700;
  font-size: 3.4vh;
  color: var(--ink);
  background: var(--grey);
  border: 0.55vh solid var(--ink);
  border-radius: 2.2vh;
  padding: 1.4vh 3vh;
  box-shadow: 0 0.8vh 0 var(--ink);
  cursor: pointer;
  transition: transform 0.06s;
}
.btn:active { transform: translateY(0.6vh); box-shadow: 0 0.2vh 0 var(--ink); }
.btn.big { font-size: 4.6vh; padding: 1.8vh 5vh; }
.btn.small { font-size: 2.8vh; padding: 1vh 2.2vh; }
.btn.red { background: var(--red); color: #fff; }
.btn.green { background: #5cc45a; color: #fff; }
.btn.yellow { background: var(--yellow); }
.btn.blue { background: #6fb1ff; }
.btn.grey { background: var(--grey); }
.btn.round { width: 6.5vh; height: 6.5vh; padding: 0; border-radius: 50%; font-size: 3.2vh; flex: none; }
.btn.red, .btn.green { text-shadow: 0 0.3vh 0 rgba(0, 0, 0, 0.35); }

/* ---------- Judul ---------- */
.title {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 6vh;
  gap: 4vh;
}
.title h1 { margin: 0; text-align: center; line-height: 1; }
.title .t1, .title .t2 {
  display: block;
  color: #fff;
  -webkit-text-stroke: 0.6vh var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 1vh 0 var(--ink);
}
.title .t1 { font-size: 15vh; color: var(--yellow); letter-spacing: 0.5vh; }
.title .t2 { font-size: 7vh; margin-top: 1vh; }
.title .btn { margin-top: auto; margin-bottom: 8vh; animation: bob 1.2s ease-in-out infinite; }

@keyframes bob { 50% { transform: translateY(-1vh); } }

/* ---------- Bar atas & peta ---------- */
.topbar {
  position: absolute;
  top: 2vh;
  left: 2vh;
  right: 2vh;
  display: flex;
  align-items: center;
  gap: 1.5vh;
  padding-top: env(safe-area-inset-top);
}
.topbar .spacer { flex: 1; }
.pill {
  background: var(--cream);
  border: 0.55vh solid var(--ink);
  border-radius: 5vh;
  padding: 0.8vh 2.4vh;
  font-weight: 700;
  font-size: 3.4vh;
  box-shadow: 0 0.6vh 0 var(--ink);
}
.nodes { position: absolute; inset: 0; pointer-events: none; }
.node {
  position: absolute;
  transform: translate(-50%, -100%);
  margin-top: -2vh;
  width: 15vh;
  height: 15vh;
  border-radius: 50%;
  border: 0.6vh solid var(--ink);
  background: var(--cream);
  box-shadow: 0 0.8vh 0 var(--ink);
  pointer-events: auto;
  padding: 0;
  cursor: pointer;
  font: inherit;
}
.node img { width: 9vh; height: 9vh; object-fit: contain; }
.node .num {
  position: absolute;
  top: -1.4vh;
  left: -1.4vh;
  width: 5.4vh;
  height: 5.4vh;
  line-height: 5vh;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  border: 0.5vh solid var(--ink);
  font-weight: 700;
  font-size: 3vh;
}
.node .lock { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 6vh; }
.node.locked { background: #b9b2a2; }
.node.locked img { filter: grayscale(1) brightness(0.7); opacity: 0.5; }
.node.done { background: #d8f5c8; }
.node.next { animation: pulse 1s ease-in-out infinite; background: #fff3a8; }
.node .stars {
  position: absolute;
  bottom: -4.2vh;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 3.6vh;
  color: var(--yellow);
  -webkit-text-stroke: 0.25vh var(--ink);
  paint-order: stroke fill;
}
@keyframes pulse { 50% { transform: translate(-50%, -100%) scale(1.08); } }
.shake { animation: shake 0.4s; }
@keyframes shake { 25% { margin-left: -1vh; } 75% { margin-left: 1vh; } }
.banner {
  position: absolute;
  bottom: 3vh;
  left: 50%;
  transform: translateX(-50%);
  background: var(--yellow);
  border: 0.55vh solid var(--ink);
  border-radius: 2vh;
  padding: 1.2vh 3vh;
  font-weight: 700;
  font-size: 3.4vh;
  box-shadow: 0 0.6vh 0 var(--ink);
  white-space: nowrap;
}

/* ---------- Kartu ---------- */
.card {
  background: var(--cream);
  border: 0.7vh solid var(--ink);
  border-radius: 3vh;
  box-shadow: 0 1.2vh 0 var(--ink);
  padding: 3vh 4vh;
  text-align: center;
  max-width: 88vw;
  animation: popin 0.25s ease-out;
}
.card h2 { margin: 0 0 1vh; font-size: 5.4vh; }
.card h3 { margin: 2vh 0 1vh; font-size: 3.4vh; text-align: left; }
.card h3 small { font-weight: 500; font-size: 2.4vh; opacity: 0.7; }
.card .row { display: flex; gap: 3vh; justify-content: center; margin-top: 2.5vh; align-items: center; }
@keyframes popin { from { transform: scale(0.7); opacity: 0; } }

.mission-card { width: 78vw; }
.mission-card .mnum {
  display: inline-block;
  background: var(--red);
  color: #fff;
  font-weight: 700;
  font-size: 2.8vh;
  border-radius: 3vh;
  padding: 0.4vh 2vh;
  border: 0.4vh solid var(--ink);
}
.mission-card .hero { width: 16vh; height: 16vh; object-fit: contain; animation: bob 1.2s ease-in-out infinite; }
.mission-card .goal { font-size: 3.8vh; margin: 1vh 0 2vh; }
.howto { display: flex; align-items: center; justify-content: center; gap: 1.2vh; }
.howto .step { display: flex; flex-direction: column; align-items: center; gap: 0.8vh; font-size: 2.4vh; width: 15vh; }
.howto .ico {
  width: 10vh;
  height: 10vh;
  border-radius: 2vh;
  border: 0.45vh solid var(--ink);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 3.6vh;
}
.howto .ico img { width: 7vh; height: 7vh; object-fit: contain; }
.howto .ico.tapb { background: #6fb1ff; position: relative; }
.howto .ico.tapb::after { content: '👆'; position: absolute; right: -1.5vh; bottom: -2vh; font-size: 4vh; animation: poke 1s infinite; }
.howto .arrow { font-size: 4vh; opacity: 0.6; margin-bottom: 3vh; }
@keyframes poke { 50% { transform: translate(-0.6vh, -0.8vh); } }

/* ---------- Dialog ---------- */
.dialog {
  position: absolute;
  left: 3vw;
  right: 3vw;
  bottom: 3vh;
  min-height: 24vh;
  display: flex;
  gap: 2.5vh;
  align-items: stretch;
  background: var(--cream);
  border: 0.7vh solid var(--ink);
  border-radius: 3vh;
  box-shadow: 0 1vh 0 var(--ink);
  padding: 2vh;
}
.dialog.pop .dtext { animation: fadein 0.3s; }
@keyframes fadein { from { opacity: 0; transform: translateY(1vh); } }
.pwrap {
  flex: none;
  width: 22vh;
  height: 22vh;
  border-radius: 2vh;
  border: 0.55vh solid var(--ink);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  background-image: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.45), transparent 60%);
}
.portrait { image-rendering: pixelated; width: 100%; height: 100%; }
.dbody { flex: 1; display: flex; flex-direction: column; gap: 1vh; }
.dname {
  align-self: flex-start;
  color: #fff;
  font-weight: 700;
  font-size: 3vh;
  padding: 0.4vh 2vh;
  border-radius: 2vh;
  border: 0.4vh solid var(--ink);
}
.dtext { font-size: 4.6vh; line-height: 1.25; flex: 1; }
.dnext { align-self: flex-end; font-size: 2.4vh; opacity: 0.65; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0.2; } }

/* ---------- Panel soal ---------- */
.back { position: absolute; top: 2vh; left: 2vh; }
.qpanel {
  position: absolute;
  left: 2vw;
  right: 2vw;
  bottom: 1.6vh;
  height: 44vh;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  background: var(--cream);
  border: 0.7vh solid var(--ink);
  border-radius: 3vh;
  box-shadow: 0 1vh 0 var(--ink);
  padding: 1.4vh 2.4vh 2vh;
  animation: slideup 0.3s ease-out;
}
@keyframes slideup { from { transform: translateY(30%); opacity: 0; } }
.qhead { display: flex; align-items: center; gap: 1.6vh; width: 100%; }
.qara {
  width: 6.5vh;
  height: 6.5vh;
  border-radius: 1.4vh;
  border: 0.4vh solid var(--ink);
  background: #f3d9a8;
  overflow: hidden;
  flex: none;
}
.qtext { flex: 1; font-size: 3.6vh; font-weight: 700; text-align: left; }
.qprog { display: flex; gap: 0.8vh; }
.qprog span { width: 2.6vh; height: 2.6vh; border-radius: 50%; border: 0.4vh solid var(--ink); background: #fff; }
.qprog span.now { background: #ffe066; }
.qprog span.ok { background: #4fb3ff; }
.qeq { font-size: 8.5vh; font-weight: 700; line-height: 1; letter-spacing: 0.5vh; }
.qeq .qm { color: var(--red); display: inline-block; animation: bob 0.9s infinite; }
.qvis { min-height: 10.5vh; display: flex; align-items: center; justify-content: center; }
.qans { display: flex; gap: 3vw; }
.ans {
  font: inherit;
  font-weight: 700;
  font-size: 8vh;
  width: min(22vw, 26vh);
  height: 12vh;
  border-radius: 2.4vh;
  border: 0.6vh solid var(--ink);
  box-shadow: 0 1vh 0 var(--ink);
  color: #fff;
  text-shadow: 0 0.4vh 0 rgba(0, 0, 0, 0.35);
  position: relative;
  cursor: pointer;
  padding: 0;
}
.ans:nth-child(1) { background: #3b8ee8; }
.ans:nth-child(2) { background: #45b04a; }
.ans:nth-child(3) { background: #9a5ae0; }
.ans:active { transform: translateY(0.6vh); box-shadow: 0 0.3vh 0 var(--ink); }
.ans.wrong { background: #b9b2a2 !important; animation: shakex 0.4s; opacity: 0.6; }
.ans.right { background: var(--yellow) !important; color: var(--ink); text-shadow: none; animation: grow 0.5s; }
.ans.glow { animation: glow 0.8s infinite; }
.ans .hand { position: absolute; right: -2vh; bottom: -5vh; font-size: 7vh; animation: poke 0.8s infinite; text-shadow: none; pointer-events: none; }
@keyframes shakex { 25% { transform: translateX(-1.2vh); } 75% { transform: translateX(1.2vh); } }
@keyframes grow { 50% { transform: scale(1.15); } }
@keyframes glow { 50% { box-shadow: 0 0 0 1vh #fff36a, 0 1vh 0 var(--ink); transform: scale(1.06); } }

/* bingkai sepuluh */
.frames { display: flex; gap: 2vh; }
.frames.groups { gap: 1.6vh; flex-wrap: wrap; justify-content: center; }
.tenframe, .group {
  display: grid;
  grid-template-columns: repeat(5, 4.8vh);
  grid-auto-rows: 4.8vh;
  gap: 0.4vh;
  padding: 0.5vh;
  background: #fff;
  border: 0.4vh solid var(--ink);
  border-radius: 1.2vh;
}
.group { display: flex; gap: 0.4vh; }
.cell { position: relative; width: 4.8vh; height: 4.8vh; display: flex; align-items: center; justify-content: center; border-radius: 0.8vh; background: #f3ead6; }
.cell.empty { background: #f3ead6; opacity: 0.55; }
.cell img { width: 4.2vh; height: 4.2vh; object-fit: contain; }
.cell i { width: 3.4vh; height: 3.4vh; border-radius: 50%; border: 0.3vh solid var(--ink); display: block; box-sizing: border-box; }
.cell.ca i { background: #ff8c1a; }
.cell.cb i { background: #4fb3ff; }
.tenframe .cell.cb img { filter: hue-rotate(180deg) saturate(1.4); }
.group:nth-child(even) { background: #e3f3ff; }
.cell.gone img, .cell.gone i { opacity: 0.3; }
.cell.gone::after { content: '✕'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--red); font-weight: 700; font-size: 3.6vh; }
.cell.counted { background: #fff36a; }
.cnum { position: absolute; top: -1.2vh; right: -0.6vh; font-size: 2.2vh; background: var(--ink); color: #fff; border-radius: 1vh; padding: 0 0.6vh; }

/* ---------- Teks melayang ---------- */
.float {
  position: absolute;
  transform: translate(-50%, -100%);
  font-weight: 700;
  font-size: 4vh;
  -webkit-text-stroke: 0.4vh #fff;
  paint-order: stroke fill;
  animation: floatup 1.4s ease-out forwards;
  white-space: nowrap;
}
@keyframes floatup { to { transform: translate(-50%, -260%); opacity: 0; } }
.praise {
  position: absolute;
  left: 50%;
  top: 22vh;
  transform: translate(-50%, -50%);
  font-weight: 700;
  font-size: 10vh;
  color: var(--yellow);
  -webkit-text-stroke: 0.7vh var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 1vh 0 var(--ink);
  animation: praise 1.3s ease-out forwards;
  white-space: nowrap;
}
@keyframes praise {
  0% { transform: translate(-50%, -50%) scale(0.3); }
  20% { transform: translate(-50%, -50%) scale(1.15); }
  30% { transform: translate(-50%, -50%) scale(1); }
  80% { opacity: 1; }
  100% { transform: translate(-50%, -90%) scale(1); opacity: 0; }
}

/* ---------- Hadiah ---------- */
.reward { width: 70vw; }
.stars.big { font-size: 10vh; letter-spacing: 1vh; color: #cfc6b2; -webkit-text-stroke: 0.4vh var(--ink); paint-order: stroke fill; }
.stars.big .on { color: var(--yellow); display: inline-block; animation: grow 0.6s; }
.gifts { display: flex; justify-content: center; gap: 6vh; margin: 2vh 0 3vh; }
.gift { display: flex; flex-direction: column; align-items: center; gap: 1vh; font-size: 3vh; }
.gift img, .gift .araprev { width: 16vh; height: 16vh; object-fit: contain; }
.gift .araprev { background: #f3d9a8; border-radius: 2vh; border: 0.45vh solid var(--ink); overflow: hidden; }
.spin { animation: spin 2s ease-in-out infinite; }
@keyframes spin { 50% { transform: rotateY(180deg) scale(1.1); } }

/* ---------- Koleksi & pengaturan ---------- */
.collection { width: 80vw; }
.badges { display: flex; justify-content: space-between; gap: 1.5vh; }
.bd { display: flex; flex-direction: column; align-items: center; gap: 0.6vh; font-size: 2.3vh; width: 14vh; }
.bd img { width: 11vh; height: 11vh; object-fit: contain; }
.bd.off img { filter: brightness(0) opacity(0.25); }
.accrow { display: flex; gap: 3vh; align-items: center; }
.arabig { width: 22vh; height: 22vh; flex: none; background: #f3d9a8; border-radius: 2vh; border: 0.45vh solid var(--ink); overflow: hidden; }
.accs { display: flex; flex-wrap: wrap; gap: 1.4vh; }
.acc {
  font: inherit;
  font-weight: 700;
  font-size: 2.8vh;
  padding: 1.2vh 2vh;
  border-radius: 1.6vh;
  border: 0.45vh solid var(--ink);
  background: #fff;
  box-shadow: 0 0.5vh 0 var(--ink);
}
.acc.on { background: var(--yellow); }
.acc.off { opacity: 0.5; }
.collection > .btn { margin-top: 3vh; }
.settings { display: flex; flex-direction: column; gap: 2vh; width: 60vw; }
.settings .note { margin: -1vh 0 0; opacity: 0.7; font-size: 2.6vh; }
.hold { position: relative; overflow: hidden; }
.hold .fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: rgba(0, 0, 0, 0.3); }
.hold.holding .fill { width: 100%; transition: width 3s linear; }
.hold .lbl { position: relative; }

/* ---------- Mode potret ---------- */
#rotate {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 10;
  background: var(--red);
  color: #fff;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 5vw;
  font-weight: 700;
  text-align: center;
}
.rot-icon { font-size: 20vw; animation: rot 2s ease-in-out infinite; }
@keyframes rot { 50% { transform: rotate(90deg); } }
body.portrait #rotate { display: flex; }

/* =========================================================
   Format top-down & battle
   ========================================================= */
#dlg { position: absolute; inset: 0; z-index: 4; display: none; }
#dlg.show { display: block; }
.dchoices { display: flex; gap: 2vh; justify-content: flex-end; }
.dchoices:empty { display: none; }

/* HUD dunia */
.hud { position: absolute; inset: 0; pointer-events: none; }
.hud.hidden { display: none; }
.hud .topbar, .hud .dpad button, .hud .abtn { pointer-events: auto; }
.hud .topbar .pill, .hud .topbar .spacer { pointer-events: none; }
.quest {
  position: absolute;
  top: 2.4vh;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 1.2vh;
  background: #fff3a8;
  border: 0.55vh solid var(--ink);
  border-radius: 5vh;
  padding: 0.6vh 2.2vh;
  font-weight: 700;
  font-size: 2.8vh;
  box-shadow: 0 0.6vh 0 var(--ink);
  white-space: nowrap;
}
.quest img { width: 4.4vh; height: 4.4vh; object-fit: contain; }
.quest .qi { position: relative; display: inline-flex; opacity: 1; }
.quest .qi.ok img { filter: grayscale(0.2); opacity: 0.55; }
.quest .qi b { position: absolute; right: -0.8vh; bottom: -0.8vh; color: #2f9e3a; font-size: 3.2vh; -webkit-text-stroke: 0.25vh #fff; paint-order: stroke fill; }

.dpad { position: absolute; left: 3vh; bottom: 3vh; width: 33vh; height: 33vh; }
.dpad button, .dpad .c {
  position: absolute;
  width: 11vh;
  height: 11vh;
  padding: 0;
  font: inherit;
  font-size: 4.6vh;
  color: var(--ink);
  background: rgba(255, 246, 224, 0.88);
  border: 0.55vh solid var(--ink);
  border-radius: 1.8vh;
  box-shadow: 0 0.7vh 0 var(--ink);
  touch-action: none;
}
.dpad .c { left: 11vh; top: 11vh; background: rgba(255, 246, 224, 0.6); box-shadow: none; border-radius: 0.6vh; }
.dpad .u { left: 11vh; top: 0; }
.dpad .d { left: 11vh; top: 22vh; }
.dpad .l { left: 0; top: 11vh; }
.dpad .r { left: 22vh; top: 11vh; }
.dpad button.on { background: #ffe066; transform: translateY(0.5vh); box-shadow: 0 0.2vh 0 var(--ink); }
.abtn {
  position: absolute;
  right: 4vh;
  bottom: 6vh;
  width: 18vh;
  height: 18vh;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  border: 0.6vh solid var(--ink);
  box-shadow: 0 0.9vh 0 var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-weight: 700;
  font-size: 6.5vh;
  line-height: 1;
  text-shadow: 0 0.4vh 0 rgba(0, 0, 0, 0.35);
  touch-action: none;
}
.abtn small { font-size: 2.6vh; margin-top: 0.5vh; }
.abtn.on { transform: translateY(0.6vh); box-shadow: 0 0.3vh 0 var(--ink); }
.teach .dpad, .teach .abtn { animation: teach 0.9s ease-in-out infinite; }
@keyframes teach { 50% { filter: drop-shadow(0 0 2vh #fff36a) brightness(1.15); } }

/* Battle */
.battle { position: absolute; inset: 0; }
.battle .ebox, .battle .pbox {
  position: absolute;
  background: var(--cream);
  border: 0.6vh solid var(--ink);
  border-radius: 2vh;
  box-shadow: 0 0.8vh 0 var(--ink);
  padding: 1.2vh 2.4vh;
  min-width: 42vh;
  animation: popin 0.3s ease-out;
}
.battle .ebox { left: 3vw; top: 4vh; }
.battle .pbox { right: 3vw; top: 46vh; }
.battle .nm { font-weight: 700; font-size: 3.6vh; display: flex; justify-content: space-between; align-items: center; gap: 2vh; }
.battle .nm img { width: 4.6vh; height: 4.6vh; object-fit: contain; }
.battle .bar { margin-top: 1vh; display: flex; align-items: center; gap: 1vh; font-weight: 700; font-size: 2.4vh; }
.battle .track { flex: 1; height: 2.6vh; background: #5a5a5a; border: 0.4vh solid var(--ink); border-radius: 1.4vh; overflow: hidden; }
.battle .fill { height: 100%; width: 100%; transition: width 0.6s ease-out; }
.battle .pbox .qprog { margin-top: 1vh; }
.battle .run { position: absolute; top: 4vh; right: 3vw; }
.bmenu { position: absolute; left: 2vw; right: 2vw; bottom: 2vh; height: 34vh; display: flex; gap: 2vh; }
.btext {
  flex: 1.15;
  position: relative;
  background: var(--cream);
  border: 0.7vh solid var(--ink);
  border-radius: 2.6vh;
  box-shadow: 0 1vh 0 var(--ink);
  padding: 2vh 3vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.4vh;
}
.btext .say { font-size: 4vh; font-weight: 700; line-height: 1.2; }
.btext.hasq .say { font-size: 3.4vh; }
.btext .eq { font-size: 11vh; font-weight: 700; line-height: 1; letter-spacing: 0.4vh; }
.btext .eq:empty { display: none; }
.btext .eq b { color: var(--red); display: inline-block; animation: bob 0.9s infinite; }
.btext .tapnext { position: absolute; right: 2.4vh; bottom: 1.6vh; font-size: 3.4vh; display: none; animation: blink 1s infinite; }
.btext.waiting .tapnext { display: block; }
.moves {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.6vh;
  background: var(--cream);
  border: 0.7vh solid var(--ink);
  border-radius: 2.6vh;
  box-shadow: 0 1vh 0 var(--ink);
  padding: 1.6vh;
}
.moves.off { opacity: 0.5; }
.moves .ans { width: auto; height: auto; font-size: 9vh; }
.moves .ans:nth-child(3) { background: #9a5ae0; }
.moves .help {
  font: inherit;
  font-weight: 700;
  font-size: 3vh;
  line-height: 1.1;
  background: #f4c430;
  border: 0.6vh solid var(--ink);
  border-radius: 2.4vh;
  box-shadow: 0 1vh 0 var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1vh;
  padding: 0;
}
.moves .help:active { transform: translateY(0.6vh); box-shadow: 0 0.3vh 0 var(--ink); }
.moves .help:disabled { opacity: 0.4; }
.moves .help span { text-align: left; }
.helppop {
  position: absolute;
  left: 2vw;
  right: 2vw;
  bottom: 38vh;
  margin: 0 auto;
  width: max-content;
  max-width: 92vw;
  background: var(--cream);
  border: 0.7vh solid var(--ink);
  border-radius: 2.6vh;
  box-shadow: 0 1vh 0 var(--ink);
  padding: 1.4vh 2.4vh 2vh;
  animation: popin 0.25s ease-out;
}
.hhead { display: flex; align-items: center; gap: 1.6vh; margin-bottom: 1.4vh; }
.hara { width: 6.5vh; height: 6.5vh; border-radius: 1.4vh; border: 0.4vh solid var(--ink); background: #f3d9a8; overflow: hidden; flex: none; }
.htext { flex: 1; font-weight: 700; font-size: 3.2vh; }
.hvis { display: flex; justify-content: center; }

/* Transisi battle */
.wipe { position: absolute; inset: 0; z-index: 8; display: flex; flex-direction: column; pointer-events: none; }
.wipe i { flex: 1; background: #1a1210; transform: scaleX(0); transition: transform 0.45s ease-in; }
.wipe i:nth-child(odd) { transform-origin: left; }
.wipe i:nth-child(even) { transform-origin: right; }
.wipe.in i { transform: scaleX(1); }
.wipe.out i { transform: scaleX(0); transition: transform 0.45s ease-out; }
.bd em { font-style: normal; color: var(--yellow); -webkit-text-stroke: 0.2vh var(--ink); paint-order: stroke fill; font-size: 2.6vh; }

.title .ver { position: absolute; right: 2vh; bottom: 1.5vh; font-size: 2.4vh; font-weight: 700; color: #fff; opacity: 0.85; text-shadow: 0 0.2vh 0 rgba(0, 0, 0, 0.4); }
.quest .qara img { width: 6vh; }

/* Analog stik */
.stick { position: absolute; width: 26vh; height: 26vh; border-radius: 50%; background: rgba(255, 246, 224, 0.35); border: 0.6vh solid rgba(43, 29, 26, 0.55); box-shadow: inset 0 0 0 1.2vh rgba(255, 255, 255, 0.25); transform: translate(-50%, -50%); pointer-events: none; z-index: 3; }
.stick .knob { position: absolute; left: 50%; top: 50%; width: 11vh; height: 11vh; border-radius: 50%; background: #ffe066; border: 0.6vh solid var(--ink); box-shadow: 0 0.7vh 0 var(--ink); transform: translate(-50%, -50%); }
.stick .ar { position: absolute; font-size: 3vh; color: rgba(43, 29, 26, 0.55); font-weight: 700; line-height: 1; }
.stick .ar.u { left: 50%; top: 1.4vh; transform: translateX(-50%); }
.stick .ar.d { left: 50%; bottom: 1.4vh; transform: translateX(-50%); }
.stick .ar.l { left: 1.4vh; top: 50%; transform: translateY(-50%); }
.stick .ar.r { right: 1.4vh; top: 50%; transform: translateY(-50%); }
#ui { touch-action: none; }
.abtn.ready { animation: ready 0.8s ease-in-out infinite; }
@keyframes ready { 50% { transform: scale(1.1); box-shadow: 0 0 0 1.2vh #fff36a, 0 0.9vh 0 var(--ink); } }
.teach::after { content: '☝️ geser di sini'; position: absolute; left: 8vh; bottom: 14vh; font-size: 4vh; font-weight: 700; color: #fff; -webkit-text-stroke: 0.4vh var(--ink); paint-order: stroke fill; animation: teachdrag 1.4s ease-in-out infinite; pointer-events: none; }
@keyframes teachdrag { 50% { transform: translate(6vh, -3vh); } }

/* =========================================================
   Kampung Hijau: murajaah & panggung Porseni
   ========================================================= */
.mj { position: absolute; inset: 0; }
.mj .run { position: absolute; top: 4vh; right: 3vw; }
.mj-title { position: absolute; left: 3vw; top: 4vh; background: var(--cream); border: 0.6vh solid var(--ink); border-radius: 2vh; box-shadow: 0 0.8vh 0 var(--ink); padding: 1.2vh 2.4vh; animation: popin 0.3s ease-out; }
.mj .ttl { font-weight: 700; font-size: 3.4vh; }
.mj .sub { font-size: 2.4vh; font-weight: 700; opacity: 0.75; }
.mj-banner { position: absolute; left: 50%; top: 5vh; transform: translateX(-50%); background: #f4c430; border: 0.6vh solid var(--ink); border-radius: 1.6vh; padding: 0.6vh 4vh; font-weight: 700; font-size: 5vh; box-shadow: 0 0.8vh 0 var(--ink); letter-spacing: 0.4vh; white-space: nowrap; }
.mj-panel { position: absolute; left: 2vw; right: 2vw; bottom: 2vh; height: 44vh; display: flex; gap: 2vh; }
.mj-left, .mj-right { background: var(--cream); border: 0.7vh solid var(--ink); border-radius: 2.6vh; box-shadow: 0 1vh 0 var(--ink); padding: 1.8vh 2.4vh; display: flex; flex-direction: column; gap: 1.2vh; min-width: 0; }
.mj-left { flex: 1.05; justify-content: center; }
.mj-right { flex: 1.2; justify-content: space-between; }
.mj-right.names { display: grid; grid-template-rows: 1fr 1fr 1fr; gap: 1.4vh; }
.mj-right.center { align-items: center; justify-content: center; }
.mj .q { font-size: 3.2vh; font-weight: 700; }
.mj .q.big { font-size: 5vh; }
.mj .latin { font-size: 3.8vh; font-weight: 700; font-style: italic; line-height: 1.2; }
.mj .latin.big { font-size: 4.6vh; }
.mj .blank { display: inline-block; min-width: 12vh; border-bottom: 0.6vh solid var(--red); color: var(--red); text-align: center; font-style: normal; }
.mj-play { font: inherit; display: flex; align-items: center; gap: 1.6vh; background: #fff; border: 0.5vh solid var(--ink); border-radius: 2vh; padding: 1.2vh 1.8vh; text-align: left; cursor: pointer; color: var(--ink); }
.mj-play b { width: 8vh; height: 8vh; border-radius: 50%; background: #3b8ee8; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 4vh; border: 0.5vh solid var(--ink); box-shadow: 0 0.6vh 0 var(--ink); flex: none; }
.mj-play.playing b { background: #45b04a; animation: grow 0.8s infinite; }
.mj-play .lbl { font-size: 3vh; font-weight: 700; }
.mj .wave { display: flex; gap: 0.6vh; align-items: center; height: 7vh; }
.mj .wave i { width: 1.1vh; height: 30%; background: #3b8ee8; border-radius: 1vh; }
.mj-play.playing .wave i { animation: wave 0.6s ease-in-out infinite; }
.mj .wave i:nth-child(3n) { animation-delay: -0.2s; height: 70%; }
.mj .wave i:nth-child(3n + 1) { animation-delay: -0.4s; height: 50%; }
@keyframes wave { 50% { transform: scaleY(1.8); } }
.mj-opt { display: flex; align-items: stretch; gap: 1.2vh; flex: 1; }
.mj-opt .spk { flex: none; width: 9vh; font-size: 3.6vh; border: 0.55vh solid var(--ink); border-radius: 2vh; background: #fff; box-shadow: 0 0.7vh 0 var(--ink); cursor: pointer; }
.mj-opt .spk.playing { background: #b8f0b0; }
.mj-opt .pickopt { flex: 1; font: inherit; font-weight: 700; font-style: italic; font-size: 3.2vh; color: #fff; text-align: left; padding: 0.8vh 1.8vh; border: 0.55vh solid var(--ink); border-radius: 2vh; box-shadow: 0 0.7vh 0 var(--ink); text-shadow: 0 0.3vh 0 rgba(0, 0, 0, 0.3); cursor: pointer; line-height: 1.15; }
.mj-opt.c0 .pickopt, .mj-name.c0 { background: #3b8ee8; }
.mj-opt.c1 .pickopt, .mj-name.c1 { background: #45b04a; }
.mj-opt.c2 .pickopt, .mj-name.c2 { background: #9a5ae0; }
.mj-opt.right .pickopt, .mj-name.right { background: var(--yellow) !important; color: var(--ink); text-shadow: none; }
.mj-opt.wrong .pickopt, .mj-name.wrong { background: #b9b2a2 !important; }
.mj-name { font: inherit; border: 0.6vh solid var(--ink); border-radius: 2vh; box-shadow: 0 0.8vh 0 var(--ink); color: #fff; font-weight: 700; font-size: 4.6vh; text-shadow: 0 0.4vh 0 rgba(0, 0, 0, 0.3); cursor: pointer; }
.mj-name.it { font-style: italic; }
.mj button:disabled { cursor: default; }
.mj-try { font-size: 3vh; font-weight: 700; color: var(--red); }
.mj .slots { display: flex; flex-direction: column; gap: 0.8vh; }
.mj .slot { display: flex; align-items: center; gap: 1.2vh; border: 0.45vh dashed var(--ink); border-radius: 1.6vh; padding: 0.4vh 1.2vh; min-height: 4.8vh; font-size: 2.8vh; font-weight: 700; font-style: italic; background: #fff; }
.mj .slots.tight .slot { min-height: 3.6vh; font-size: 2.3vh; padding: 0.2vh 1vh; }
.mj .slot.ok { border-style: solid; background: #d8f5c8; }
.mj .slot em { font-style: normal; width: 4vh; height: 4vh; border-radius: 50%; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 2.2vh; flex: none; }
.mj .cards { display: flex; flex-wrap: wrap; gap: 1vh; align-content: flex-start; overflow: auto; }
.mj .card2 { font: inherit; border: 0.5vh solid var(--ink); border-radius: 1.6vh; box-shadow: 0 0.6vh 0 var(--ink); padding: 0.8vh 1.4vh; font-size: 2.6vh; font-weight: 700; font-style: italic; background: #ffe066; cursor: pointer; color: var(--ink); text-align: left; }
.mj .card2.used { visibility: hidden; }
.mj .card2.shake { animation: shakex 0.4s; background: #ffb3a8; }

/* Pilih wilayah di layar judul */
.title .regions { margin-top: auto; margin-bottom: 7vh; display: flex; gap: 3vh; }
.title .regions .btn { animation: bob 1.2s ease-in-out infinite; display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.title .regions .btn small { font-size: 2.6vh; opacity: 0.9; margin-top: 0.4vh; }
.title .regions .btn:nth-child(2) { animation-delay: -0.6s; }
.title .regions .btn:disabled { filter: grayscale(0.8); opacity: 0.7; animation: none; }
.bd canvas.kid { width: 8vh; height: 10.4vh; image-rendering: pixelated; }
.title .regions .btn { margin: 0; }
.mj-right.names { justify-content: stretch; align-content: stretch; justify-items: stretch; }
.mj-right.names > button { width: 100%; }
.mj.stage-on .mj-panel { height: 50vh; }
.mj .slots.tight { gap: 0.5vh; }
.mj .slots.tight .slot { min-height: 3.4vh; font-size: 2.1vh; padding: 0.1vh 1vh; }
.mj .slots.tight .slot em { width: 3.2vh; height: 3.2vh; font-size: 1.8vh; }
.mj .cards .card2 { font-size: 2.3vh; padding: 0.6vh 1.2vh; }
