/* ==========================================================================
   Peta petualangan: perjalanan bergambar melewati dunia-dunia bertema.
   Semua kelas berawalan `pt-`. Pemandangan SVG dibuat di js/worlds.js,
   layarnya di js/screens/map.js.
   ========================================================================== */

/* Warna operasi aktif dipakai kepala peta, cincin tombol, dan jalur. */
.pt-op-add { --pt-op: var(--op-add); --pt-op-soft: var(--op-add-soft); --pt-op-ink: var(--op-add-ink); }
.pt-op-sub { --pt-op: var(--op-sub); --pt-op-soft: var(--op-sub-soft); --pt-op-ink: var(--op-sub-ink); }
.pt-op-mul { --pt-op: var(--op-mul); --pt-op-soft: var(--op-mul-soft); --pt-op-ink: var(--op-mul-ink); }
.pt-op-div { --pt-op: var(--op-div); --pt-op-soft: var(--op-div-soft); --pt-op-ink: var(--op-div-ink); }
.pt-op-topik { --pt-op: var(--op-topik); --pt-op-soft: var(--op-topik-soft); --pt-op-ink: var(--op-topik-ink); }

.pt {
  --pt-h: 300px;          /* tinggi satu dunia di HP */
  --pt-node: 78px;        /* tombol tahap: jauh di atas 72px untuk jari anak */
  --pt-boss: 96px;
  --pt-buddy: 96px;
  --pt-chip-bg: var(--surface);
  --pt-road: #FFF1CF;
  --pt-road-edge: rgba(84, 54, 18, .28);
  --pt-fog: rgba(238, 243, 255, .24);
  --pt-dim: transparent;
  --pt-puff: #FFFFFF;
  --pt-puff-shade: #DCE3F8;
}
[data-theme="dark"] .pt {
  --pt-road: #F2E2BC;
  --pt-road-edge: rgba(0, 0, 0, .38);
  --pt-fog: rgba(12, 18, 48, .42);
  --pt-dim: rgba(8, 12, 40, .2);
  --pt-puff: #DCE2F6;
  --pt-puff-shade: #9BA6CF;
}

/* ---------- kepala: pindah operasi + ringkasan ---------- */

.pt-head {
  position: relative;
  margin-bottom: 14px;
  padding: 10px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--pt-op) 22%, transparent), transparent 60%),
    var(--surface);
  box-shadow: var(--shadow-1);
}

.pt-ops { display: flex; gap: 6px; }
/* Banyak topik (kelas 1–6): satu baris yang digeser mendatar, tab tidak menciut. */
.pt-ops.geser {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  margin: -4px -10px 0;
  padding: 4px 10px 6px;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 12px, #000 calc(100% - 22px), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 12px, #000 calc(100% - 22px), transparent 100%);
}
.pt-ops.geser::-webkit-scrollbar { display: none; }
.pt-ops.geser .pt-op { flex: 0 0 auto; width: 72px; min-height: 60px; scroll-snap-align: center; }
.pt-ops.geser .pt-op-emo { font-size: 24px; }
.pt-ops.geser .pt-op-txt { font-size: 12px; max-width: 66px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-op {
  flex: 1;
  min-width: 0;
  min-height: 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--ink-2);
  font-family: 'Baloo 2', sans-serif;
  cursor: pointer;
  transition: transform var(--dur-1) var(--ease), background var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
.pt-op:active { transform: scale(.95); }
.pt-op-emo { font-size: 19px; line-height: 1.1; }
.pt-op-txt { font-size: 12.5px; font-weight: 800; line-height: 1.1; }
.pt-op.pt-op-add { --c: var(--op-add); }
.pt-op.pt-op-sub { --c: var(--op-sub); }
.pt-op.pt-op-mul { --c: var(--op-mul); }
.pt-op.pt-op-div { --c: var(--op-div); }
.pt-op.pt-op-topik { --c: var(--op-topik); }
.pt-op.active {
  background: var(--c);
  color: #fff;
  box-shadow: 0 4px 0 color-mix(in srgb, var(--c) 70%, #000), 0 8px 18px color-mix(in srgb, var(--c) 35%, transparent);
  transform: translateY(-2px);
}

.pt-status {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 2px 4px 0;
}
.pt-where { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 0 1 auto; }
.pt-where-emo {
  width: 44px; height: 44px; flex: 0 0 44px;
  display: grid; place-items: center;
  font-size: 24px;
  border-radius: 14px;
  background: var(--pt-op-soft);
  animation: pt-bob 3s ease-in-out infinite;
}
.pt-where-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.pt-where-txt small { font-size: 11.5px; font-weight: 800; color: var(--ink-3); }
.pt-where-txt b {
  font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 16px; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pt-prog { flex: 1; min-width: 0; }
.pt-prog-row { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; margin-bottom: 4px; }
.pt-prog-row span { font-size: 12px; font-weight: 800; color: var(--ink-3); line-height: 1.2; }
.pt-prog-row b { font-family: 'Baloo 2', sans-serif; font-size: 17px; font-weight: 800; color: var(--ink-2); }
.pt-prog .bar-fill { background: var(--pt-op); }
.pt-starsum {
  display: flex; align-items: center; gap: 4px;
  margin-top: 5px;
  font-size: 11.5px; font-weight: 800; color: var(--ink-3);
}
.pt-starsum .pt-star { width: 14px; height: 14px; }
.pt-review { width: 100%; margin-top: 10px; }

/* ---------- perjalanan ---------- */

.pt-journey {
  position: relative;
  margin: 0 -16px;
  border-radius: 28px;
  overflow: hidden;
  background: #8FD3FF;
  box-shadow: 0 10px 30px rgba(22, 32, 74, .14);
  isolation: isolate;
}

.pt-band { position: relative; height: var(--pt-h); }
.pt-band-start { height: calc(var(--pt-h) * 1.62); }
.pt-band-boss { height: calc(var(--pt-h) * 1.3); }

.pt-scene { position: absolute; inset: 0; overflow: hidden; }
.pt-scene-svg { display: block; width: 100%; height: 100%; }
/* Malam hari (tema gelap): pemandangan sedikit diredupkan, label tetap jelas. */
.pt-scene::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--pt-dim);
  pointer-events: none;
}
/* Dunia yang belum terbuka: berkabut tipis dan pudar, tetap mengundang. */
.pt-fog .pt-scene-svg { filter: saturate(.7); }
.pt-fog .pt-scene::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--pt-fog);
  pointer-events: none;
}

/* Awan pemisah antardunia. */
.pt-seam {
  position: absolute;
  left: 0;
  top: -22px;
  width: 100%;
  height: 44px;
  z-index: 1;
  pointer-events: none;
}
.pt-seam-puff { fill: var(--pt-puff); }
.pt-seam-shade { fill: var(--pt-puff-shade); opacity: .9; }

/* Jalur berkelok. */
.pt-track { position: absolute; left: 0; top: 0; z-index: 2; pointer-events: none; overflow: visible; }
.pt-road-edge { fill: none; stroke: var(--pt-road-edge); stroke-width: 24; stroke-linecap: round; opacity: .55; }
.pt-road { fill: none; stroke: var(--pt-road); stroke-width: 17; stroke-linecap: round; opacity: .6; }
.pt-road-dots { fill: none; stroke: rgba(120, 96, 60, .45); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 1 15; }
.pt-road-edge.on { opacity: 1; }
.pt-road.on { opacity: 1; }
.pt-road-dots.on { stroke: var(--pt-op); stroke-width: 6.5; stroke-dasharray: 1 14; transition: stroke .4s ease; }

/* ---------- titik di jalur ---------- */

/* Wadah tak berukuran di pusat tombol; anak-anaknya diletakkan relatif. */
.pt-spot { position: absolute; width: 0; height: 0; z-index: 3; }

.pt-node {
  position: absolute;
  left: calc(var(--pt-node) / -2);
  top: calc(var(--pt-node) / -2);
  width: var(--pt-node);
  height: var(--pt-node);
  display: grid;
  place-items: center;
  padding: 0;
  border: 5px solid #fff;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, color-mix(in srgb, var(--pt-op) 22%, #fff) 70%);
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--pt-op) 75%, #fff),
    0 7px 0 color-mix(in srgb, var(--pt-op) 60%, #1b2340),
    0 12px 22px rgba(10, 16, 50, .32);
  cursor: pointer;
  transition: transform var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
/* Bidang ketuk lebih besar daripada gambarnya. */
.pt-node::before { content: ''; position: absolute; inset: -14px; border-radius: 50%; }
.pt-node:active {
  transform: translateY(5px);
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--pt-op) 75%, #fff),
    0 2px 0 color-mix(in srgb, var(--pt-op) 60%, #1b2340),
    0 5px 12px rgba(10, 16, 50, .28);
}
.pt-node-face { font-size: calc(var(--pt-node) * .44); line-height: 1; }
.pt-node-badge {
  position: absolute;
  right: -8px;
  bottom: -6px;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  font-size: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(10, 16, 50, .25);
}

/* Selesai tiga bintang: cincin emas. */
.pt-node.done {
  border-color: #FFE8A0;
  background: radial-gradient(circle at 35% 30%, #FFFBEA, #FFE08A 75%);
  box-shadow:
    0 0 0 4px var(--gold),
    0 7px 0 #C98A00,
    0 12px 24px rgba(201, 138, 0, .4);
}
/* Terkunci: abu-abu. */
.pt-node.locked {
  border-color: #EEF1F8;
  background: radial-gradient(circle at 35% 30%, #F4F6FB, #C9D0E2 80%);
  box-shadow: 0 0 0 3px #AEB7CF, 0 6px 0 #8A93AD, 0 10px 18px rgba(10, 16, 50, .25);
  cursor: not-allowed;
}
.pt-node.locked .pt-node-face { filter: grayscale(1); opacity: .5; }
.pt-node.locked .pt-node-badge { background: #EEF1F8; }

/* Tahap yang sedang dimainkan: bercahaya dan berdenyut. */
.pt-node.frontier { animation: pt-throb 1.8s ease-in-out infinite; }
.pt-node.frontier::after {
  content: '';
  position: absolute;
  inset: -9px;
  border-radius: 50%;
  border: 4px solid color-mix(in srgb, var(--pt-op) 80%, #fff);
  animation: pt-ring 1.8s ease-out infinite;
  pointer-events: none;
}
.pt-node.frontier.done::after { border-color: var(--gold); }

.pt-boss { --pt-node: var(--pt-boss); }
.pt-lesson:not(.done):not(.locked) {
  background: radial-gradient(circle at 35% 30%, #fff, #D8F6E8 75%);
  box-shadow: 0 0 0 3px var(--ok), 0 7px 0 #0E8A5B, 0 12px 22px rgba(10, 16, 50, .3);
}
.pt-lesson.done {
  border-color: #fff;
  background: radial-gradient(circle at 35% 30%, #fff, #DDF6EC 80%);
  box-shadow: 0 0 0 3px var(--ok), 0 7px 0 #0E8A5B, 0 12px 22px rgba(10, 16, 50, .28);
}

.pt-shake { animation: pt-shake .45s ease both !important; }

/* Bendera "Main!" di atas tahap saat ini. */
.pt-flag {
  position: absolute;
  left: 0;
  bottom: calc(var(--pt-node) / 2 + 12px);
  transform: translateX(-50%);
  padding: 4px 12px 5px;
  border-radius: 999px;
  background: var(--pt-op);
  color: #fff;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 15px;
  line-height: 1.1;
  white-space: nowrap;
  box-shadow: 0 3px 0 color-mix(in srgb, var(--pt-op) 65%, #000), 0 6px 14px rgba(10, 16, 50, .28);
  animation: pt-flag-bounce 1.4s ease-in-out infinite;
  pointer-events: none;
}
.pt-flag::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -6px;
  margin-left: -6px;
  border: 6px solid transparent;
  border-bottom: 0;
  border-top-color: var(--pt-op);
}
.pt-lesson ~ .pt-flag { background: var(--ok); box-shadow: 0 3px 0 #0E8A5B, 0 6px 14px rgba(10, 16, 50, .28); }
.pt-lesson ~ .pt-flag::after { border-top-color: var(--ok); }
.pt-boss ~ .pt-flag { --pt-node: var(--pt-boss); }

/* Bintang di bawah tombol. */
.pt-stars {
  position: absolute;
  left: 0;
  top: calc(var(--pt-node) / 2 + 6px);
  transform: translateX(-50%);
  display: flex;
  gap: 1px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(20, 26, 66, .55);
}
.pt-boss ~ .pt-stars { top: calc(var(--pt-boss) / 2 + 6px); }
.pt-star { display: inline-block; width: 19px; height: 19px; }
.pt-star svg { display: block; width: 100%; height: 100%; fill: rgba(255, 255, 255, .35); }
.pt-star.on svg { fill: var(--gold); filter: drop-shadow(0 1px 0 #B57F00); }

/* Label dunia + nama tahap. */
.pt-chip {
  position: absolute;
  left: 0;
  top: calc(var(--pt-node) / 2 + 34px);
  transform: translateX(-50%);
  width: max-content;
  max-width: min(200px, 48vw);
  padding: 6px 12px 7px;
  border-radius: 16px;
  background: var(--pt-chip-bg);
  box-shadow: 0 4px 14px rgba(10, 16, 50, .2);
  text-align: center;
  line-height: 1.2;
  pointer-events: none;
}
.pt-node.locked ~ .pt-chip { top: calc(var(--pt-node) / 2 + 12px); opacity: .92; }
.pt-lesson ~ .pt-chip { top: calc(var(--pt-node) / 2 + 12px); }
.pt-boss ~ .pt-chip { top: calc(var(--pt-boss) / 2 + 34px); max-width: min(240px, 70vw); }
.pt-boss.locked ~ .pt-chip { top: calc(var(--pt-boss) / 2 + 12px); }
.pt-chip-kicker { display: block; font-size: 11.5px; font-weight: 800; color: var(--pt-op-ink); }
[data-theme="dark"] .pt-chip-kicker { color: color-mix(in srgb, var(--pt-op) 70%, #fff); }
.pt-chip b { display: block; font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 15.5px; color: var(--ink); }
.pt-chip b i { font-style: normal; font-family: 'Nunito', sans-serif; font-size: 11.5px; font-weight: 800; color: var(--ink-3); margin-left: 2px; }
.pt-chip small { display: block; margin-top: 1px; font-size: 11.5px; font-weight: 700; color: var(--ink-3); }

/* ---------- teman belajar ---------- */

.pt-buddy {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  z-index: 4;
  will-change: transform;
}
.pt-buddy-hop {
  position: absolute;
  left: calc(var(--pt-buddy) / -2);
  bottom: -6px;
  width: var(--pt-buddy);
  height: var(--pt-buddy);
  cursor: pointer;
}
.pt-buddy-face { width: 100%; height: 100%; transition: transform .28s var(--ease); }
.pt-buddy-face.flip { transform: scaleX(-1); }
.pt-buddy-fig, .pt-buddy-fig .mascot { display: block; width: 100%; height: 100%; }
.pt-buddy-hop.pt-hop { animation: pt-buddy-hop .8s cubic-bezier(.3, .7, .4, 1) both; }

/* Kabar tiba di dunia baru. */
.pt-arrive {
  position: absolute;
  z-index: 5;
  transform: translate(-50%, -100%);
  padding: 7px 14px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #FFD54A, #FF9F1C);
  color: #4A2A00;
  font-family: 'Baloo 2', sans-serif;
  font-weight: 800;
  font-size: 16px;
  white-space: nowrap;
  box-shadow: 0 4px 0 #C97400, 0 10px 24px rgba(10, 16, 50, .3);
  animation: pt-arrive 3.2s ease both;
  pointer-events: none;
}

/* ---------- gerak pemandangan ---------- */

/* Pangkal transformasi mengikuti kotak benda itu sendiri. */
.pt-scene-svg *, .pt-backdrop * { transform-box: fill-box; }

.pt-drift { animation: pt-drift 14s ease-in-out infinite alternate; }
.pt-glow { animation: pt-glow 3.5s ease-in-out infinite; transform-origin: center; }
.pt-glow-win { animation: pt-glow-win 2.4s ease-in-out infinite; }
.pt-ring { animation: pt-sun-ring 4s ease-out infinite; transform-origin: center; }
.pt-fly { animation: pt-fly 22s linear infinite; }
.pt-flap { animation: pt-flap .5s ease-in-out infinite alternate; transform-origin: center; }
.pt-sway { animation: pt-sway 6s ease-in-out infinite alternate; transform-origin: 50% 100%; }
.pt-sway-big { animation: pt-sway-big 4.5s ease-in-out infinite alternate; transform-origin: 50% 100%; }
.pt-vine { animation: pt-sway 5s ease-in-out infinite alternate; transform-origin: 50% 0%; }
.pt-bob { animation: pt-bob 3s ease-in-out infinite; }
.pt-float { animation: pt-float 6s ease-in-out infinite; }
.pt-wave { animation: pt-wave 3s linear infinite; }
.pt-surf { animation: pt-surf 4s ease-in-out infinite; }
.pt-scuttle { animation: pt-scuttle 4s ease-in-out infinite; }
.pt-snap { animation: pt-snap 1.6s ease-in-out infinite; transform-origin: 50% 100%; }
.pt-swim-r { animation: pt-swim-r 18s linear infinite; }
.pt-swim-l { animation: pt-swim-l 18s linear infinite; }
.pt-wiggle { animation: pt-wiggle .9s ease-in-out infinite alternate; transform-origin: 60% 50%; }
.pt-rise { animation: pt-rise 6s ease-in infinite; }
.pt-ray { animation: pt-ray 6s ease-in-out infinite; }
.pt-jelly { animation: pt-jelly 3.6s ease-in-out infinite; }
.pt-trek { animation: pt-trek 46s linear infinite; }
.pt-plod { animation: pt-plod .9s ease-in-out infinite; }
.pt-leg-a { animation: pt-leg-a .9s ease-in-out infinite; transform-origin: 50% 0%; }
.pt-leg-b { animation: pt-leg-b .9s ease-in-out infinite; transform-origin: 50% 0%; }
.pt-roll { animation: pt-roll 9s linear infinite; }
.pt-spin { animation: pt-spin 1.3s linear infinite; transform-origin: center; }
.pt-heat { animation: pt-heat 3s ease-in-out infinite; }
.pt-water { animation: pt-water .7s linear infinite; }
.pt-flutter { animation: pt-flutter .35s ease-in-out infinite alternate; transform-origin: center; }
.pt-flutter-path { animation: pt-flutter-path 9s ease-in-out infinite; }
.pt-waddle { animation: pt-waddle 1.4s ease-in-out infinite; transform-origin: 50% 100%; }
.pt-snow { animation: pt-snow 8s linear infinite; }
.pt-wavy { animation: pt-flag-wave 1.4s ease-in-out infinite alternate; transform-origin: 0% 50%; }
.pt-twinkle { animation: pt-twinkle 2.6s ease-in-out infinite; transform-origin: center; }
.pt-shoot { animation: pt-shoot 7s ease-in infinite; }
.pt-flicker { animation: pt-flicker .25s ease-in-out infinite alternate; transform-origin: 50% 0%; }
.pt-burst { animation: pt-burst 3.4s ease-out infinite; transform-origin: center; }

/* Dunia di luar layar berhenti bergerak supaya HP tetap ringan. */
.pt-band:not(.pt-live) .pt-scene * { animation-play-state: paused !important; }

@keyframes pt-drift { from { transform: translateX(-22px); } to { transform: translateX(22px); } }
@keyframes pt-glow { 0%, 100% { opacity: .75; transform: scale(.94); } 50% { opacity: 1; transform: scale(1.06); } }
@keyframes pt-glow-win { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@keyframes pt-sun-ring { from { transform: scale(.8); opacity: .8; } to { transform: scale(1.5); opacity: 0; } }
@keyframes pt-fly {
  0% { transform: translate(-260px, 0); }
  25% { transform: translate(-90px, -8px); }
  50% { transform: translate(80px, 4px); }
  75% { transform: translate(250px, -6px); }
  100% { transform: translate(420px, 0); }
}
@keyframes pt-flap { from { transform: scaleY(1); } to { transform: scaleY(-.5); } }
@keyframes pt-sway { from { transform: rotate(-3deg); } to { transform: rotate(3deg); } }
@keyframes pt-sway-big { from { transform: rotate(-9deg) skewX(-4deg); } to { transform: rotate(9deg) skewX(4deg); } }
@keyframes pt-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes pt-float { 0%, 100% { transform: translateY(-5px) rotate(-1.5deg); } 50% { transform: translateY(6px) rotate(1.5deg); } }
@keyframes pt-wave { from { transform: translateX(0); } to { transform: translateX(-40px); } }
@keyframes pt-surf { 0%, 100% { transform: translate(-6px, 1px); } 50% { transform: translate(6px, -2px); } }
@keyframes pt-scuttle {
  0%, 100% { transform: translateX(-22px); }
  12% { transform: translateX(-22px) rotate(-4deg); }
  45% { transform: translateX(22px); }
  58% { transform: translateX(22px) rotate(4deg); }
}
@keyframes pt-snap { 0%, 70%, 100% { transform: rotate(0); } 80% { transform: rotate(-18deg); } 90% { transform: rotate(10deg); } }
@keyframes pt-swim-r {
  0% { transform: translate(-330px, 0); }
  25% { transform: translate(-165px, -6px); }
  50% { transform: translate(0, 4px); }
  75% { transform: translate(165px, -5px); }
  100% { transform: translate(330px, 0); }
}
@keyframes pt-swim-l {
  0% { transform: translate(330px, 0); }
  25% { transform: translate(165px, 5px); }
  50% { transform: translate(0, -5px); }
  75% { transform: translate(-165px, 4px); }
  100% { transform: translate(-330px, 0); }
}
@keyframes pt-wiggle { from { transform: rotate(-5deg); } to { transform: rotate(5deg); } }
@keyframes pt-rise {
  0% { transform: translate(0, 0); opacity: 0; }
  12% { opacity: 1; }
  50% { transform: translate(5px, -100px); }
  100% { transform: translate(-3px, -210px); opacity: 0; }
}
@keyframes pt-ray { 0%, 100% { opacity: .05; } 50% { opacity: .14; } }
@keyframes pt-jelly {
  0%, 100% { transform: translateY(6px) scale(1, 1); }
  30% { transform: translateY(2px) scale(1.08, .9); }
  60% { transform: translateY(-10px) scale(.94, 1.08); }
}
@keyframes pt-trek { from { transform: translateX(-320px); } to { transform: translateX(320px); } }
@keyframes pt-plod { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.6px); } }
@keyframes pt-leg-a { 0%, 100% { transform: rotate(12deg); } 50% { transform: rotate(-12deg); } }
@keyframes pt-leg-b { 0%, 100% { transform: rotate(-12deg); } 50% { transform: rotate(12deg); } }
@keyframes pt-roll {
  0% { transform: translate(-320px, 0); }
  20% { transform: translate(-190px, -10px); }
  30% { transform: translate(-130px, 0); }
  50% { transform: translate(0, -14px); }
  62% { transform: translate(80px, 0); }
  80% { transform: translate(200px, -8px); }
  100% { transform: translate(320px, 0); }
}
@keyframes pt-spin { to { transform: rotate(360deg); } }
@keyframes pt-heat { 0%, 100% { transform: translateY(0); opacity: 0; } 50% { transform: translateY(-8px); opacity: .7; } }
@keyframes pt-water { to { stroke-dashoffset: -22; } }
@keyframes pt-flutter { from { transform: scaleX(1); } to { transform: scaleX(.25); } }
@keyframes pt-flutter-path {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(40px, -18px); }
  50% { transform: translate(70px, 6px); }
  75% { transform: translate(24px, -10px); }
}
@keyframes pt-waddle { 0%, 100% { transform: rotate(-7deg) translateX(-2px); } 50% { transform: rotate(7deg) translateX(2px); } }
@keyframes pt-snow {
  0% { transform: translate(0, -250px); opacity: 0; }
  8% { opacity: 1; }
  50% { transform: translate(9px, -125px); }
  100% { transform: translate(-4px, 0); opacity: .9; }
}
@keyframes pt-flag-wave { from { transform: skewY(-8deg) scaleX(.92); } to { transform: skewY(8deg) scaleX(1.05); } }
@keyframes pt-twinkle { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .25; transform: scale(.6); } }
@keyframes pt-shoot {
  0%, 70% { transform: translate(0, 0); opacity: 0; }
  74% { opacity: 1; }
  90% { transform: translate(120px, 48px); opacity: 0; }
  100% { transform: translate(120px, 48px); opacity: 0; }
}
@keyframes pt-flicker { from { transform: scaleY(.75); } to { transform: scaleY(1.15); } }
@keyframes pt-burst {
  0% { transform: scale(.1); opacity: 0; }
  10% { opacity: 1; }
  45% { transform: scale(1); opacity: .9; }
  70%, 100% { transform: scale(1.15); opacity: 0; }
}

/* Gerak antarmuka peta. */
@keyframes pt-throb { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }
@keyframes pt-ring { 0% { transform: scale(.92); opacity: .95; } 100% { transform: scale(1.35); opacity: 0; } }
@keyframes pt-flag-bounce { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, -5px); } }
@keyframes pt-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px) rotate(-4deg); }
  40% { transform: translateX(6px) rotate(3deg); }
  60% { transform: translateX(-4px) rotate(-2deg); }
  80% { transform: translateX(3px); }
}
@keyframes pt-buddy-hop {
  0% { transform: translateY(0) scale(1, 1); }
  15% { transform: translateY(0) scale(1.1, .88); }
  45% { transform: translateY(-26px) scale(.94, 1.08); }
  75% { transform: translateY(0) scale(1.08, .9); }
  100% { transform: translateY(0) scale(1, 1); }
}
@keyframes pt-arrive {
  0% { transform: translate(-50%, -60%) scale(.3); opacity: 0; }
  12% { transform: translate(-50%, -110%) scale(1.12); opacity: 1; }
  20% { transform: translate(-50%, -100%) scale(1); }
  82% { transform: translate(-50%, -100%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -150%) scale(.9); opacity: 0; }
}

/* ---------- latar pita bawah (dipakai layar kuis petualangan) ---------- */

.pt-backdrop {
  display: block;
  width: 100%;
  height: 120px;
  opacity: .7;
  pointer-events: none;
}
[data-theme="dark"] .pt-backdrop { opacity: .4; }

/* ---------- gerak dikurangi ---------- */

@media (prefers-reduced-motion: reduce) {
  .pt-scene *, .pt-backdrop *, .pt-node.frontier, .pt-node.frontier::after, .pt-flag,
  .pt-where-emo, .pt-buddy-hop, .pt-seam * { animation: none !important; }
}
html[data-motion="reduced"] .pt-scene *, html[data-motion="reduced"] .pt-backdrop *,
html[data-motion="reduced"] .pt-node.frontier, html[data-motion="reduced"] .pt-node.frontier::after,
html[data-motion="reduced"] .pt-flag, html[data-motion="reduced"] .pt-where-emo,
html[data-motion="reduced"] .pt-buddy-hop { animation: none !important; }

/* ---------- tablet ---------- */

@media (min-width: 720px) {
  .pt { --pt-h: 330px; --pt-node: 86px; --pt-boss: 104px; --pt-buddy: 112px; }
  .pt-journey { margin: 0 -24px; }
  .pt-head { padding: 12px; }
  .pt-op { flex-direction: row; gap: 8px; min-height: 52px; }
  .pt-op-emo { font-size: 21px; }
  .pt-op-txt { font-size: 15px; }
  .pt-ops.geser .pt-op { width: auto; padding: 0 14px; }
  .pt-ops.geser .pt-op-emo { font-size: 21px; }
  .pt-ops.geser .pt-op-txt { font-size: 14px; max-width: none; }
  .pt-chip { max-width: 230px; }
  .pt-chip b { font-size: 17px; }
  .pt-where-txt b { font-size: 18px; }
}

/* ---------- laptop: peta di kolom utama, bersudut membulat ---------- */

@media (min-width: 1024px) {
  .pt { --pt-h: 320px; }
  .pt-journey { margin: 0; }
  .pt-head { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 4px 16px; align-items: center; }
  .pt-status { margin-top: 0; }
  .pt-head .pt-ops.geser { grid-column: 1 / -1; }
  .pt-review { grid-column: 1 / -1; }
}
