/* Peta Indonesia: Jelajah, Tebak di Peta, Tebak Daerah Asal, Pasangkan, Letakkan Provinsi, Kuis Campuran */
:root { --pi: #0369a1; --pi-soft: #e0f2fe; }
.pi-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; padding: clamp(8px, 1.6vw, 18px); overflow-y: auto; overflow-x: hidden; background: linear-gradient(180deg, #f0f9ff, #fff 60%); -webkit-overflow-scrolling: touch; }
.pi-view { display: flex; flex-direction: column; gap: clamp(6px, 1.2vh, 14px); flex: 1; min-height: 0; min-width: 0; }
.pi-view[hidden] { display: none; }
.pi-hud { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; }
.pi-hud:empty { display: none; }
.pi-chip { background: #fff; border: 3px solid var(--c); color: var(--ink); border-radius: 999px; padding: 2px 14px; font-weight: 800; font-size: clamp(13px, 1.6vw, 19px); display: inline-flex; gap: 8px; align-items: baseline; }
.pi-chip b { font-size: 1.2em; font-variant-numeric: tabular-nums; }
.pi-chip.on { background: var(--c); color: #fff; }
.pi-qn { font-weight: 800; color: var(--muted); font-size: clamp(13px, 1.5vw, 17px); margin-left: 6px; }
.pi-ask { text-align: center; font-weight: 800; color: var(--ink); font-size: clamp(15px, 2.1vw, 24px); line-height: 1.3; --c: var(--pi); }
.pi-ask .tm { display: block; color: var(--c); font-size: .8em; }
.pi-ask small { color: var(--muted); font-weight: 700; }

/* kartu soal */
.pi-prompt { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: #fff; border: 4px solid var(--pi); border-radius: 24px; padding: 8px 14px; text-align: center; min-height: 0; }
.pi-prompt:empty { display: none; }
.pi-quiz .pi-prompt { min-height: clamp(96px, 22vh, 220px); }
.pi-chipk { display: inline-block; background: var(--pi-soft); color: var(--pi); border-radius: 999px; padding: 0 12px; font-weight: 800; font-size: clamp(12px, 1.4vw, 16px); }
.pi-emo { font-size: clamp(34px, 8vh, 72px); line-height: 1.1; }
.pi-img { width: clamp(80px, 20vh, 170px); height: clamp(60px, 15vh, 130px); object-fit: cover; border-radius: 14px; }
.pi-big { font-weight: 800; font-size: clamp(24px, 5.5vh, 52px); color: var(--ink); line-height: 1.15; }
.pi-big small { display: block; font-size: .38em; color: var(--muted); font-weight: 700; }
.pi-clue { font-weight: 700; color: var(--ink); font-size: clamp(15px, 2.2vw, 26px); line-height: 1.35; max-width: 40em; }
.pi-sub { font-weight: 700; color: var(--muted); font-size: clamp(12px, 1.4vw, 16px); }
.pi-sil { width: clamp(80px, 18vh, 150px); height: clamp(54px, 12vh, 100px); }
.pi-sil path { fill: var(--f, #7dd3fc); stroke: #0c4a6e; stroke-width: 1; vector-effect: non-scaling-stroke; stroke-linejoin: round; }

/* pilihan ganda */
.pi-opts { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(8px, 1.4vw, 16px); }
@media (min-width: 900px) and (min-aspect-ratio: 5/3) { .pi-opts { grid-template-columns: repeat(4, 1fr); } }
.pi-opt { position: relative; min-height: clamp(56px, 10vh, 100px); padding: 6px 12px 6px 22px; border-radius: 20px; border: 4px solid var(--pi-soft); background: #fff; color: var(--ink); font: 800 clamp(16px, 2.4vw, 28px)/1.2 var(--font); cursor: pointer; display: flex; align-items: center; justify-content: center; text-align: center; overflow-wrap: anywhere; }
.pi-opt:hover:not(:disabled) { border-color: var(--pi); }
.pi-opt kbd { position: absolute; top: 4px; left: 8px; font: 800 12px var(--font); color: var(--muted); opacity: .7; }
.pi-opt:disabled { cursor: default; }
.pi-opt.good { background: #bbf7d0; border-color: var(--ok); }
.pi-opt.bad { background: #fecdd3; border-color: var(--bad); }
.pi-fb { min-height: 1.4em; text-align: center; font-weight: 800; color: var(--muted); font-size: clamp(13px, 1.7vw, 20px); line-height: 1.35; }
.pi-fb.ok { color: var(--ok); } .pi-fb.bad { color: var(--bad); }
.pi-fb:empty { min-height: 0; }
.pi-next { align-self: center; margin-top: 0; min-height: 52px; padding: 0 34px; font-size: clamp(18px, 2vw, 24px); }
.pi-next[hidden] { display: none; }

/* peta */
.pi-mapview { display: flex; flex-direction: column; gap: 8px; }
.pi-side { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pi-side > * { flex: none; }
.pi-side.done .pi-tools { display: none; }
.pi-mapbox { position: relative; flex: 1; min-height: 210px; border: 3px solid #bae6fd; border-radius: 18px; background: #e0f2fe; overflow: hidden; touch-action: none; }
.pi-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
.pi-svg.drag { cursor: grabbing; }
.pi-prov { fill: var(--f); stroke: #fff; stroke-width: 1px; vector-effect: non-scaling-stroke; stroke-linejoin: round; cursor: pointer; outline: none; transition: fill .15s; }
.pi-prov:focus-visible { stroke: #0f172a; stroke-width: 3px; }
@media (hover: hover) { .pi-prov:hover { filter: brightness(.88); } }
.pi-prov.dim, .pi-pin.dim { opacity: .35; }
.pi-prov.sel { stroke: #0f172a; stroke-width: 2.5px; }
.pi-prov.good { fill: #4ade80; stroke: #166534; stroke-width: 2.5px; }
.pi-prov.bad { fill: #fb7185; stroke: #9f1239; stroke-width: 2.5px; }
.pi-prov.seen { stroke: #475569; }
.pi-pin { cursor: pointer; }
.pi-pin .hit { fill: transparent; stroke: none; pointer-events: all; }
.pi-pin .vis { fill: var(--f, #fff); stroke: #0f172a; stroke-width: 2px; vector-effect: non-scaling-stroke; }
.pi-pin.hid { display: none; }
.pi-pin.good .vis { fill: #4ade80; } .pi-pin.bad .vis { fill: #fb7185; } .pi-pin.sel .vis { fill: #fde047; }
@media (hover: hover) { .pi-pin:hover .vis { filter: brightness(.88); } }
.pi-lab { font-family: var(--font); font-weight: 800; fill: #0f172a; text-anchor: middle; paint-order: stroke; stroke: #fff; stroke-width: 3px; stroke-linejoin: round; pointer-events: none; }
.pi-lab.hid { display: none; }
.pi-zoom { position: absolute; top: 6px; right: 6px; display: flex; flex-direction: row; gap: 6px; z-index: 3; }
.pi-zb { width: 44px; height: 44px; flex: none; border-radius: 14px; border: 2px solid #7dd3fc; background: #fff; color: var(--sky-d); font: 800 24px/1 var(--font); cursor: pointer; padding: 0; box-shadow: 0 2px 6px rgba(3,105,161,.25); }
.pi-zb.pi-fit { font-size: 14px; }
.pi-zb:hover { background: var(--sky-50); }
.pi-credit { position: absolute; left: 6px; top: 6px; margin: 0; font-size: 10px; line-height: 1.25; color: #334155; background: rgba(255,255,255,.82); padding: 1px 6px; border-radius: 8px; z-index: 2; max-width: calc(100% - 164px); pointer-events: none; }
.pi-credit a { pointer-events: auto; }
.pi-credit a { color: inherit; }
.pi-tools { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; justify-content: center; }
.pi-tools[hidden], .pi-pick[hidden], .pi-foot[hidden] { display: none; }
.pi-pick { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 6px; align-items: center; font-weight: 800; font-size: clamp(12px, 1.4vw, 15px); color: var(--ink); }
.pi-pick select { font: 700 clamp(13px, 1.4vw, 16px) var(--font); padding: 6px 8px; border: 2px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); min-height: 40px; max-width: 190px; }
.pi-mini { min-width: 40px; min-height: 40px; padding: 0 12px; border-radius: 12px; border: 2px solid var(--line); background: #fff; font: 800 14px var(--font); color: var(--ink); cursor: pointer; }
.pi-mini[aria-pressed="true"] { background: var(--pi-soft); border-color: var(--pi); }
.pi-foot { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.pi-prog { font-weight: 800; color: var(--muted); font-size: clamp(12px, 1.4vw, 16px); }
.pi-done { margin-top: 0; min-height: 46px; padding: 0 22px; font-size: clamp(15px, 1.8vw, 19px); }
.pi-help { font-weight: 700; color: var(--muted); font-size: clamp(13px, 1.5vw, 17px); text-align: center; }

@media (min-aspect-ratio: 3/2) and (min-width: 700px) {
  .pi-mapview { flex-direction: row; align-items: stretch; }
  .pi-side { flex: 0 0 clamp(210px, 31%, 360px); overflow-y: auto; justify-content: center; }
  .pi-mapbox { min-height: 0; }
  .pi-side .pi-prompt { padding: 6px 10px; }
}
@media (max-width: 699px) {
  .pi-side.done .pi-prompt { display: none; }
  .pi-mapbox { min-height: 250px; } .pi-fit { font-size: 13px; }
  .pi-mapview .pi-ask { font-size: 14px; } .pi-mapview .pi-ask .tm { display: inline; margin-right: 6px; } .pi-mapview .pi-ask .tm::after { content: ' \00b7'; }
  .pi-mapview .pi-prompt { padding: 4px 10px; border-width: 3px; gap: 2px; border-radius: 18px; }
  .pi-mapview .pi-emo { display: none; } .pi-mapview .pi-big { font-size: 22px; } .pi-mapview .pi-clue { font-size: 15px; } .pi-mapview .pi-img { height: 54px; width: 72px; }
  .pi-mapview .pi-chipk { font-size: 11px; }
  .pi-mapview .pi-side { gap: 4px; }
}

/* pasangkan */
.pi-mem { --ch: 90px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; align-content: start; }
.pi-card { position: relative; height: var(--ch); min-width: 0; perspective: 600px; border: 0; background: none; padding: 0; cursor: pointer; font-family: var(--font); }
.pi-card .in { position: absolute; inset: 0; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 3px; text-align: center; font-weight: 800; line-height: 1.12; overflow: hidden; }
.pi-card .back { background: linear-gradient(135deg, #0ea5e9, #0369a1); color: #fff; font-size: clamp(22px, 5vw, 38px); }
.pi-card .front { display: none; background: #fff; border: 3px solid var(--pi); color: var(--ink); font-size: clamp(11px, 1.9vw, 19px); overflow-wrap: anywhere; }
.pi-card .front .e { font-size: clamp(18px, 3.4vw, 34px); line-height: 1; }
.pi-card .front small { font-size: .72em; color: var(--muted); font-weight: 700; }
.pi-card.prov .front { background: #ecfeff; border-color: #0891b2; }
.pi-card.up .back, .pi-card.done .back { display: none; }
.pi-card.up .front, .pi-card.done .front { display: flex; }
.pi-card.done .front { background: #bbf7d0; border-color: var(--ok); }
.pi-card.miss .front { background: #fecdd3; border-color: var(--bad); }
.pi-card:disabled { cursor: default; }
.pi-mem.tiny .front .e, .pi-mem.tiny .front small { display: none; }
.pi-mem.tiny .front { font-size: clamp(10px, 1.7vw, 15px); padding: 1px; letter-spacing: -.2px; }

/* kartu provinsi */
.pi-detail { text-align: center; }
.pi-dtop { display: flex; align-items: center; justify-content: center; gap: clamp(10px, 3vw, 24px); flex-wrap: wrap; padding: 0 40px; }
.pi-dname { text-align: left; min-width: 0; }
.pi-dname h2 { margin: 0; font-size: clamp(24px, 4.5vw, 40px); line-height: 1.15; }
.pi-meta { margin: 4px 0 0; display: grid; gap: 2px; font-size: clamp(13px, 1.6vw, 17px); }
.pi-meta div { display: flex; gap: 6px; flex-wrap: wrap; }
.pi-meta dt { font-weight: 800; color: var(--muted); }
.pi-meta dt::after { content: ':'; }
.pi-meta dd { margin: 0; font-weight: 800; color: var(--ink); }
.pi-group { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 8px 0 0; }
.pi-group button { min-height: 38px; padding: 0 12px; border-radius: 999px; border: 2px solid var(--line); background: #fff; font: 800 14px var(--font); color: var(--ink); cursor: pointer; }
.pi-group button[aria-pressed="true"] { background: var(--pi); border-color: var(--pi); color: #fff; }
.pi-note { margin: 8px 0 0 !important; padding: 6px 12px; background: var(--amber-100); border-radius: 12px; color: #92400e !important; font-weight: 700; font-size: clamp(12px, 1.5vw, 15px) !important; text-align: left; }
.pi-note[hidden], .pi-group[hidden] { display: none; }
.pi-tabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; margin: 10px 0 8px; }
.pi-tab { min-height: 52px; padding: 2px 2px; border-radius: 12px; border: 2px solid var(--line); background: #fff; color: var(--ink); font: 800 clamp(10px, 1.5vw, 13px)/1.1 var(--font); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; }
.pi-tab .e { font-size: clamp(18px, 3vw, 24px); line-height: 1; }
.pi-tab[aria-selected="true"] { background: var(--pi); border-color: var(--pi); color: #fff; }
.pi-tabbody { text-align: left; display: flex; flex-direction: column; gap: 8px; min-height: 90px; }
.pi-item { display: flex; gap: 10px; align-items: flex-start; background: var(--sky-50); border: 2px solid var(--line); border-radius: 14px; padding: 8px 12px; }
.pi-item .e { font-size: 28px; line-height: 1.1; flex: none; }
.pi-item img { width: 88px; height: 66px; object-fit: cover; border-radius: 10px; flex: none; }
.pi-item h4 { margin: 0; font-size: clamp(15px, 2vw, 19px); color: var(--ink); }
.pi-item p { margin: 2px 0 0; font-size: clamp(13px, 1.7vw, 16px); color: var(--muted); line-height: 1.4; }
.pi-detail .actions { position: static; background: none; }
.pi-names { display: grid; gap: 6px; }
.pi-names input { font: 700 16px var(--font); padding: 8px 14px; border: 2px solid var(--line); border-radius: 999px; min-width: 0; width: 100%; box-sizing: border-box; text-align: center; }
.pi-names input[hidden] { display: none; }
.pi-recap { display: flex; flex-direction: column; gap: 4px; font-size: clamp(15px, 2vw, 22px); margin-bottom: 4px; }
.pi-small .opt { min-height: 40px; padding: 0 11px; font-size: clamp(13px, 1.5vw, 16px); }
.setup-cols .pi-small .opt { min-height: 40px; padding: 0 11px; font-size: clamp(13px, 1.5vw, 16px); }
.pi-attr { margin: 12px 0 0 !important; font-size: 12px !important; color: var(--muted); }
.pi-attr a { color: inherit; }

@media (max-height: 520px) {
  .pi-side.done .pi-prompt { display: none; }
  .pi-mapview .pi-emo { display: none; }
  .pi-side { gap: 3px; }
  .pi-mapview .pi-fb { font-size: 12px; line-height: 1.25; }
  .pi-mapview .pi-next { position: sticky; bottom: 0; }
  .pi-wrap { gap: 4px; padding: 4px 8px; }
  .pi-view { gap: 4px; }
  .pi-prompt { border-width: 3px; padding: 4px 10px; }
  .pi-quiz .pi-prompt { min-height: 64px; }
  .pi-emo { font-size: 30px; } .pi-big { font-size: 22px; } .pi-clue { font-size: 14px; }
  .pi-sil { width: 70px; height: 46px; }
  .pi-opt { min-height: 44px; border-width: 3px; font-size: 17px; }
  .pi-opts { grid-template-columns: repeat(4, 1fr); }
  .pi-ask { font-size: 14px; }
  .pi-mapbox { min-height: 0; border-width: 2px; }
  .pi-zb { width: 40px; height: 40px; }
  .pi-next { min-height: 42px; font-size: 17px; padding: 0 24px; }
  .pi-tools { gap: 4px 8px; }
  .pi-tab { min-height: 42px; }
  .pi-tabs { grid-template-columns: repeat(10, 1fr); }
  .pi-fb { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
