/* Petualangan Peta: tampilan peta, penggaris, tali ukur, panel soal */
.pt { --pt: #0284c7; --pt-soft: #e0f2fe; --pt-amber: #f59e0b; }
.pt-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; padding: clamp(6px, 1.2vw, 14px); overflow-y: auto; overflow-x: hidden; background: linear-gradient(180deg, #f0f9ff, #fff 60%); -webkit-overflow-scrolling: touch; }
.pt-main { display: flex; flex-direction: column; gap: 10px; flex: 1 0 auto; min-height: 0; }

/* HUD */
.pt-hud { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; }
.pt-hud:empty { display: none; }
.pt-chip { background: #fff; border: 3px solid var(--c); color: var(--ink); border-radius: 999px; padding: 1px 12px; font-weight: 800; font-size: clamp(13px, 1.5vw, 18px); display: inline-flex; gap: 8px; align-items: baseline; }
.pt-chip b { font-size: 1.2em; font-variant-numeric: tabular-nums; }
.pt-chip.on { background: var(--c); color: #fff; }
.pt-qn { font-weight: 800; color: var(--muted); font-size: clamp(13px, 1.4vw, 17px); margin-left: 6px; }

/* kolom peta */
.pt-mapcol { position: relative; flex: none; height: clamp(230px, 44vh, 460px); border-radius: 18px; overflow: hidden; border: 3px solid #fff; box-shadow: 0 6px 18px rgba(14, 116, 144, .25); background: #7fd0f2; }
.pt-mapbox { position: absolute; inset: 0; }
.pt-svg { width: 100%; height: 100%; display: block; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; background: #7fd0f2; cursor: grab; }
.pt-zoom { position: absolute; top: 8px; right: 8px; display: flex; flex-direction: column; gap: 6px; z-index: 3; }
.pt-zoom[hidden] { display: none; }
.pt-zoom button { width: 46px; height: 46px; border-radius: 14px; border: 2px solid #fff; background: rgba(255, 255, 255, .94); color: var(--ink); font: 800 26px/1 var(--font); cursor: pointer; padding: 0; box-shadow: 0 3px 10px rgba(15, 23, 42, .25); display: grid; place-items: center; }
.pt-zoom button svg { width: 22px; height: 22px; }
.pt-zoom button:active { background: var(--amber); }
.pt-maptip { position: absolute; left: 8px; right: 62px; bottom: 8px; z-index: 3; background: rgba(15, 23, 42, .88); color: #fff; font-weight: 700; font-size: 14px; line-height: 1.35; padding: 8px 12px; border-radius: 12px; opacity: 0; pointer-events: none; transition: opacity .25s; }
.pt-maptip.on { opacity: 1; }

/* panel samping */
.pt-side { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 2px; }
.pt-mission { display: flex; flex-direction: column; gap: 0; text-align: left; background: var(--pt-soft); border-radius: 14px; padding: 6px 12px; }
.pt-mission:empty { display: none; }
.pt-mi { font-weight: 800; color: var(--ink); font-size: clamp(15px, 1.8vw, 20px); line-height: 1.25; }
.pt-mi .ic { font-size: 1.15em; }
.pt-ms { font-weight: 700; color: var(--muted); font-size: clamp(12px, 1.4vw, 15px); }
.pt-story { background: #fff7e0; border: 2px solid #fde68a; border-radius: 14px; padding: 7px 12px; color: #78350f; font-weight: 700; font-size: clamp(13px, 1.5vw, 17px); line-height: 1.4; text-align: left; }
.pt-story[hidden] { display: none; }
.pt-ask { text-align: left; color: var(--ink); }
.pt-q { font-weight: 800; font-size: clamp(15px, 1.8vw, 21px); line-height: 1.4; color: var(--ink); }
.pt-q.pt-open { color: var(--ok); }
.pt-who { font-weight: 800; font-size: clamp(13px, 1.5vw, 17px); margin-bottom: 2px; }
.pt-tag { display: inline-block; font-weight: 800; font-size: 12px; color: var(--pt); background: var(--pt-soft); border-radius: 999px; padding: 1px 10px; margin-bottom: 4px; }
.pt-scale { margin-top: 4px; font-weight: 700; color: var(--muted); font-size: clamp(13px, 1.5vw, 16px); }
.pt-scale b { color: var(--ink); }
.pt-how { margin-top: 4px; font-weight: 700; color: var(--muted); font-size: clamp(13px, 1.5vw, 16px); line-height: 1.4; }
.pt-coord { font-weight: 800; color: #92400e; font-size: clamp(12px, 1.4vw, 15px); margin-top: 3px; }
.pt-piece { background: #ecfdf5; border: 2px solid #a7f3d0; border-radius: 12px; padding: 6px 10px; margin-top: 6px; text-align: left; display: flex; flex-direction: column; font-size: clamp(13px, 1.5vw, 16px); line-height: 1.4; color: var(--ink); }
.pt-piece b { color: #047857; }
.pt-piece.next { background: #eff6ff; border-color: #bfdbfe; }
.pt-piece.next b { color: #1d4ed8; }
.pt-story .pt-piece { margin-top: 4px; }

/* UI penggaris */
.pt-rulerui { background: #fff; border: 3px solid var(--pt-soft); border-radius: 16px; padding: 8px 10px; display: flex; flex-direction: column; gap: 8px; }
.pt-rulerui[hidden] { display: none; }
.pt-read { font-weight: 700; color: var(--ink); font-size: clamp(14px, 1.7vw, 18px); line-height: 1.35; text-align: left; }
.pt-read b { color: #c2410c; font-size: 1.15em; }
.pt-typebox { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--ink); font-weight: 800; }
.pt-typebox[hidden] { display: none; }
.pt-typebox label { font-size: clamp(13px, 1.5vw, 16px); }
.pt-typebox input { width: 92px; font: 800 22px var(--font); text-align: center; padding: 6px 4px; border: 3px solid var(--pt-soft); border-radius: 14px; color: var(--ink); background: #fff; min-height: 46px; }
.pt-typebox input:focus { outline: none; border-color: var(--pt); }
.pt-typebox input:disabled { background: #f1f5f9; }
.pt-typebox .step { width: 46px; height: 46px; border-radius: 14px; border: 3px solid var(--pt-soft); background: var(--sky-50); color: var(--pt); font: 800 24px/1 var(--font); cursor: pointer; padding: 0; }
.pt-rbtns { display: flex; flex-wrap: wrap; gap: 8px; }
.pt-btn { min-height: 46px; padding: 0 16px; border-radius: 999px; border: 3px solid var(--line); background: #fff; color: var(--ink); font: 800 clamp(14px, 1.6vw, 17px) var(--font); cursor: pointer; }
.pt-btn.main { background: var(--pt); border-color: var(--pt); color: #fff; }
.pt-btn.small { min-height: 44px; font-size: 14px; color: var(--muted); }
.pt-btn:disabled { opacity: .5; cursor: default; }
.pt-btn[hidden] { display: none; }
.pt-rulerui .mini { display: none; }

/* pilihan jawaban */
.pt-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.pt-opts:empty { display: none; }
.pt-opt { position: relative; min-height: 54px; padding: 8px 12px 8px 30px; border-radius: 16px; border: 3px solid var(--pt-soft); background: #fff; color: var(--ink); font: 800 clamp(16px, 2vw, 21px)/1.2 var(--font); cursor: pointer; display: flex; align-items: center; justify-content: center; text-align: center; font-variant-numeric: tabular-nums; }
.pt-opt kbd { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); font: 800 12px var(--font); color: #fff; background: var(--pt); width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; }
.pt-opt:hover:not(:disabled) { border-color: var(--pt); }
.pt-opt:disabled { cursor: default; }
.pt-opt.good { background: #bbf7d0; border-color: var(--ok); }
.pt-opt.bad { background: #fecdd3; border-color: var(--bad); }
.pt-fb { min-height: 1.2em; font-weight: 800; color: var(--muted); font-size: clamp(14px, 1.6vw, 18px); line-height: 1.35; text-align: left; }
.pt-fb.ok { color: var(--ok); }
.pt-fb.bad { color: var(--bad); }
.pt-pemb { white-space: pre-line; background: #f0f9ff; border: 2px solid var(--pt-soft); border-radius: 14px; padding: 8px 12px; color: var(--ink); text-align: left; font-weight: 600; font-size: clamp(13px, 1.5vw, 16px); line-height: 1.5; }
.pt-pemb[hidden] { display: none; }
.pt-nav { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; }
.pt-next { margin-top: 0; min-height: 56px; padding: 0 32px; font-size: clamp(18px, 2vw, 24px); }
.pt-next[hidden] { display: none; }

/* dua peta berdampingan */
.pt-dual { position: absolute; inset: 0; display: flex; gap: 8px; align-items: center; justify-content: center; padding: 6px 6px; background: #e0f2fe; }
.pt-cell { display: flex; flex-direction: column; min-width: 0; flex: 0 1 auto; gap: 3px; }
.pt-cap { font-weight: 800; color: var(--ink); font-size: clamp(11px, 1.3vw, 15px); line-height: 1.2; text-align: center; }
.pt-cap span { color: var(--pt); white-space: nowrap; }
.pt-mini { position: relative; width: 100%; aspect-ratio: 400 / 272; border-radius: 10px; overflow: hidden; border: 3px solid #fff; box-shadow: 0 3px 10px rgba(15, 23, 42, .25); }
.pt-mini .pt-svg { cursor: default; }

/* isi SVG pulau */
.pg-lab { font-family: var(--font); font-weight: 800; fill: #0f172a; stroke: #fff; paint-order: stroke; stroke-linejoin: round; pointer-events: none; }
.pg-title { font-family: var(--font); font-weight: 800; fill: #0c4a6e; stroke: #fff; paint-order: stroke; stroke-linejoin: round; stroke-width: 4px; pointer-events: none; }
.pg-n { font-family: var(--font); font-weight: 800; fill: #be123c; pointer-events: none; }
.pg-sk { font-family: var(--font); font-weight: 800; fill: #0f172a; stroke: #fff; paint-order: stroke; stroke-linejoin: round; pointer-events: none; }
.pg-sl { font-family: var(--font); font-weight: 800; fill: #0f172a; stroke: #fff; paint-order: stroke; stroke-linejoin: round; pointer-events: none; }

/* penggaris */
.pt-ruler { touch-action: none; }
.pt-ruler.off .rh { cursor: default; }
.pt-ruler .strip { fill: rgba(254, 240, 138, .93); stroke: #a16207; stroke-width: 1px; cursor: move; }
.pt-ruler .ticks { stroke: #7c2d12; fill: none; pointer-events: none; }
.pt-ruler .tl text { font-family: var(--font); font-weight: 800; fill: #7c2d12; pointer-events: none; }
.pt-ruler .rh { cursor: grab; touch-action: none; outline: none; }
.pt-ruler .rh .dot { fill: #f97316; stroke: #fff; }
.pt-ruler .rh .core { fill: #fff; pointer-events: none; }
.pt-ruler .rh:focus-visible .dot { stroke: #0f172a; }
.pt-ruler .bub { pointer-events: none; }
.pt-ruler .bub rect { fill: #0f172a; opacity: .92; }
.pt-ruler .bub text { fill: #fff; font-family: var(--font); font-weight: 800; }
.pt-ruler .ring { fill: rgba(249, 115, 22, .15); stroke: #f97316; stroke-dasharray: 4 3; pointer-events: none; }
.pt-ruler .ring.ok { stroke: #16a34a; fill: rgba(22, 163, 74, .2); stroke-dasharray: none; }
.pt-rope .rl { stroke: #f97316; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.pt-rope .rd { fill: #fff; stroke: #ea580c; pointer-events: none; }
.pt-rope .rd.free { fill: #fde68a; }
.pt-rope .rs { font-family: var(--font); font-weight: 800; fill: #9a3412; stroke: #fff; paint-order: stroke; stroke-linejoin: round; pointer-events: none; }
.pt-seg .dp { fill: #fff; stroke: #e11d48; }
.pt-seg .dl { font-family: var(--font); font-weight: 800; fill: #7f1d1d; stroke: #fff; paint-order: stroke; stroke-linejoin: round; }
.pt-seg .dt { font-family: var(--font); font-weight: 800; fill: #0f172a; stroke: #fff; paint-order: stroke; stroke-linejoin: round; }
.pt-seg .dt.good { fill: #15803d; }

/* peta harta karun */
.hk-ax { font-family: var(--font); font-weight: 700; fill: #4b7a8a; pointer-events: none; }
.hk-leg { fill: none; stroke-linecap: round; pointer-events: none; }
.hk-leg.todo { stroke: #a16207; opacity: .55; }
.hk-leg.now { stroke: #dc2626; opacity: .95; }
.hk-leg.done { stroke: #16a34a; opacity: .9; }
.hk-pos .dot { fill: #9ca3af; stroke: #fff; }
.hk-pos .ring { fill: none; stroke: #f59e0b; opacity: 0; }
.hk-pos.active .dot { fill: #f59e0b; }
.hk-pos.active .ring { opacity: 1; animation: hkPulse 1.6s ease-out infinite; transform-box: fill-box; transform-origin: center; }
.hk-pos.done .dot { fill: #16a34a; }
.hk-pos.locked .dot { fill: #94a3b8; }
.hk-pos .num { font-family: var(--font); font-weight: 800; fill: #fff; pointer-events: none; }
.hk-pos .lock { display: none; pointer-events: none; }
.hk-pos.locked .lock { display: inline; }
.hk-pos.locked .num { display: none; }
.hk-pos.next .dot { fill: #64748b; }
.hk-pos.sel .dot { stroke: #0f172a; }
.nm { font-family: var(--font); font-weight: 800; fill: #3f2a0d; stroke: #fff7e0; paint-order: stroke; stroke-linejoin: round; pointer-events: none; }
.nm.hide { display: none; }
.hk-title { font-family: var(--script); fill: #7c4a12; stroke: #fff4cf; paint-order: stroke; stroke-linejoin: round; pointer-events: none; }
.hk-n { font-family: var(--font); font-weight: 800; fill: #c2410c; pointer-events: none; }
.hk-sk .skb { fill: rgba(255, 252, 240, .85); rx: 6px; }
.hk-sk .skr { fill: #3f2a0d; stroke: #3f2a0d; }
.hk-sk .skt, .hk-sk .skl { font-family: var(--font); font-weight: 800; fill: #3f2a0d; }
.band.lat { fill: rgba(37, 99, 235, .2); stroke: #2563eb; stroke-width: 1px; stroke-dasharray: 5 3; pointer-events: none; }
.band.lon { fill: rgba(124, 58, 237, .2); stroke: #7c3aed; stroke-width: 1px; stroke-dasharray: 5 3; pointer-events: none; }
.hk-guess .gc { fill: rgba(239, 68, 68, .25); stroke: #dc2626; stroke-width: 2px; }
.hk-guess .gt { font-family: var(--font); font-weight: 800; fill: #dc2626; text-anchor: middle; }
@keyframes hkPulse { 0% { transform: scale(.8); opacity: 1; } 100% { transform: scale(1.5); opacity: 0; } }

/* pengaturan */
.pt-names { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.pt-names[hidden] { display: none; }
.pt-names input { font: 700 16px var(--font); padding: 8px 12px; min-height: 44px; border: 2px solid var(--line); border-radius: 999px; min-width: 0; width: 100%; box-sizing: border-box; text-align: center; }
.pt-names input[hidden] { display: none; }
.pt-saved { margin-top: 12px; background: #fff7e0; border: 2px solid #fde68a; border-radius: 16px; padding: 8px 12px; }
.pt-saved[hidden] { display: none; }
.pt-saved p { margin: 0 0 6px !important; font-size: 15px !important; }
.pt-saved .secondary { margin-top: 0; min-height: 44px; font-size: 16px; }
.pt-recap { display: flex; flex-direction: column; gap: 4px; font-size: clamp(15px, 2vw, 22px); margin-bottom: 4px; }
.op-desc { text-align: center; }

/* layar lebar atau HP mendatar: peta di kiri, soal di kanan */
@media (orientation: landscape) and (min-width: 640px) {
  .pt-wrap { overflow: hidden; }
  .pt-main { flex-direction: row; flex: 1 1 0; align-items: stretch; gap: clamp(8px, 1.6vw, 20px); }
  .pt-mapcol { flex: 1 1 56%; height: auto; min-height: 0; }
  .pt-side { flex: 1 1 44%; overflow-y: auto; overflow-x: hidden; min-height: 0; padding-right: 4px; }
}
@media (max-height: 520px) {
  .pt-wrap { gap: 3px; padding: 4px 8px; }
  .pt-side { gap: 5px; }
  .pt-opt { min-height: 46px; border-width: 3px; padding-top: 4px; padding-bottom: 4px; }
  .pt-mission { padding: 3px 10px; }
  .pt-story { padding: 4px 10px; }
  .pt-btn { min-height: 44px; }
  .pt-next { min-height: 48px; }
  .pt-zoom button { width: 44px; height: 44px; }
  .pt-names { grid-template-columns: 1fr 1fr 1fr 1fr; }
}
@media (max-width: 420px) { .pt-opts { grid-template-columns: 1fr 1fr; } .pt-opt { padding-left: 26px; font-size: 16px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
/* target sentuh minimal 44 px, juga pada layar pendek */
.pt .topbar .iconbtn { min-width: 44px; min-height: 44px; }
.pt .topbar .iconbtn.ic { width: 44px; }
.pt .rotate-hint button { min-height: 44px; }
@media (orientation: landscape) and (min-width: 600px) {
  #overlay-setup .panel { width: min(980px, 100%); }
  #overlay-setup .setup-cols { grid-template-columns: 1.2fr .8fr; }
}
@media (max-height: 520px) {
  #overlay-setup .panel > p { display: none; }
  #overlay-setup .panel h1 { margin-bottom: 0; }
  .pt-saved { margin-top: 6px; }
}
