/* Pasar Pintar: gaya halaman main (awalan pp-). Uang mainan digambar dengan CSS: bukan uang asli, tanpa gambar bitmap. */
.pp { --pp: #ea580c; --pp-soft: #ffedd5; --pp-line: #fed7aa; }
.pp-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; padding: clamp(6px, 1.4vw, 14px); overflow-y: auto; overflow-x: hidden; background: linear-gradient(180deg, #fff7ed, #fff 55%); -webkit-overflow-scrolling: touch; }
.pp-hud { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; }
.pp-hud:empty { display: none; }
.pp-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; }
.pp-chip b { font-size: 1.2em; font-variant-numeric: tabular-nums; }
.pp-chip.on { background: var(--c); color: #fff; }
.pp-qn { font-weight: 800; color: var(--muted); font-size: clamp(13px, 1.4vw, 17px); margin-left: 6px; }
.pp-split { display: flex; flex-direction: column; gap: clamp(8px, 1.6vw, 14px); flex: 1 0 auto; min-height: 0; }
.pp-split[hidden] { display: none; }
.pp-left, .pp-right { display: flex; flex-direction: column; gap: clamp(6px, 1.2vh, 10px); min-width: 0; }
.pp-right { align-items: stretch; }

/* kolom kiri: tenda, cerita, barang, uang */
.pp-awning { display: block; width: 100%; height: clamp(18px, 4.5vh, 36px); border-radius: 10px 10px 14px 14px; flex: none; box-shadow: 0 3px 0 rgba(180, 83, 9, .25); }
.pp-ask { text-align: center; font-weight: 800; font-size: clamp(14px, 1.7vw, 20px); }
.pp-ask:empty { display: none; }
.pp-story { font-weight: 700; color: var(--ink); background: #fff; border: 3px solid var(--pp-line); border-radius: 18px; padding: 8px 14px; font-size: clamp(15px, 1.7vw, 21px); line-height: 1.45; text-align: left; }
.pp-story b { color: #c2410c; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pp-trans { background: #eff6ff; border: 3px solid #bfdbfe; border-radius: 16px; padding: 6px 12px; color: #1e3a8a; font-weight: 700; font-size: clamp(13px, 1.5vw, 18px); line-height: 1.4; }
.pp-trans[hidden], .pp-cash[hidden], .pp-receipt[hidden], .pp-tray[hidden], .pp-key[hidden], .pp-tabs[hidden], .pp-btns .primary[hidden] { display: none; }
.pp-trans div + div { margin-top: 3px; }
.pp-dialog { display: flex; flex-direction: column; gap: 6px; }
.pp-dialog:empty, .pp-items:empty, .pp-opts:empty, .pp-picks:empty, .pp-fb:empty { display: none; }
.pp-bub { position: relative; max-width: 92%; background: #fff; border: 3px solid; border-radius: 18px; padding: 6px 14px 8px; font-weight: 800; color: var(--ink); font-size: clamp(16px, 2.1vw, 26px); line-height: 1.3; }
.pp-bub small { display: block; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.pp-bub.c { border-color: #7dd3fc; align-self: flex-start; background: #f0f9ff; border-bottom-left-radius: 4px; }
.pp-bub.s { border-color: #fcd34d; align-self: flex-end; background: #fffbeb; border-bottom-right-radius: 4px; }

.pp-items { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding-bottom: 8px; border-bottom: 8px solid #b45309; border-radius: 0 0 6px 6px; }
.pp-item, .pp-pick { width: clamp(88px, 12vw, 118px); background: #fff; border: 3px solid #fde68a; border-radius: 16px; padding: 6px 4px 6px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 1px; font: inherit; color: var(--ink); }
.pp-em { position: relative; display: inline-block; line-height: 0; }
.pp-em img { width: clamp(34px, 6vh, 50px); height: clamp(34px, 6vh, 50px); display: block; }
.pp-x { position: absolute; top: -4px; right: -14px; background: var(--pp); color: #fff; border-radius: 999px; font: 800 12px/1 var(--font); font-style: normal; padding: 3px 5px; }
.pp-nm { font-weight: 800; font-size: clamp(12px, 1.35vw, 15px); line-height: 1.15; overflow-wrap: anywhere; }
.pp-qt { font-weight: 700; color: var(--muted); font-size: 12px; }
.pp-tag { display: inline-block; margin-top: 2px; background: #fef08a; color: #713f12; border-radius: 6px 10px 10px 6px; padding: 1px 8px 1px 10px; font-weight: 800; font-size: clamp(12px, 1.3vw, 14px); font-variant-numeric: tabular-nums; position: relative; }
.pp-tag::before { content: ""; position: absolute; left: 3px; top: 50%; width: 4px; height: 4px; margin-top: -2px; border-radius: 50%; background: #ca8a04; }
.pp-per { font-size: 11px; font-weight: 700; color: var(--muted); line-height: 1.1; }

.pp-cash { background: #fff; border: 3px dashed var(--pp-line); border-radius: 16px; padding: 6px 8px; text-align: center; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 12px; }
.pp-cap { font-weight: 800; color: var(--ink); font-size: clamp(14px, 1.6vw, 19px); }
.pp-cap b { color: #c2410c; }
.pp-cards { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; }
.pp-pc { display: inline-flex; }
.pp-swap { gap: 10px; }
.pp-eq { font-size: 30px; color: var(--ink); }
.pp-q { font: 800 34px var(--font); color: var(--pp); border: 3px dashed var(--pp-line); border-radius: 12px; min-width: 52px; min-height: 52px; display: inline-grid; place-items: center; }
.pp-target { font-weight: 800; font-size: clamp(18px, 2.4vw, 28px); color: var(--ink); } .pp-target b { color: #c2410c; font-size: 1.3em; }
.pp-bigtag { display: inline-block; background: #fef08a; color: #713f12; border: 4px solid #ca8a04; border-radius: 12px; padding: 4px 22px; font: 800 clamp(28px, 6vh, 52px)/1.2 var(--font); font-variant-numeric: tabular-nums; }

.pp-receipt { background: #fffef5; border: 2px dashed #a8a29e; border-radius: 6px; padding: 8px 14px; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; color: #292524; font-size: clamp(13px, 1.5vw, 17px); }
.pp-rt { text-align: center; font-weight: 800; letter-spacing: .12em; border-bottom: 2px dashed #a8a29e; padding-bottom: 4px; margin-bottom: 4px; }
.pp-receipt .r { display: flex; justify-content: space-between; gap: 10px; line-height: 1.5; }
.pp-receipt .r b { font-variant-numeric: tabular-nums; }
.pp-receipt .r.nol { color: var(--muted); font-style: italic; }
.pp-receipt .r.tot { border-top: 2px solid #292524; margin-top: 4px; padding-top: 3px; font-weight: 800; }
.pp-receipt .r.sisa { color: var(--ok); font-weight: 800; } .pp-receipt .r.sisa.over { color: var(--bad); }

/* kolom kanan: pilihan, papan angka, nampan uang */
.pp-opts { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(6px, 1.2vw, 12px); }
.pp-opts.wide { grid-template-columns: 1fr; }
.pp-opt { position: relative; min-height: clamp(54px, 9vh, 88px); padding: 6px 10px; border-radius: 18px; border: 4px solid var(--pp-line); background: #fff; color: var(--ink); font: 800 clamp(20px, 3vw, 32px)/1.15 var(--font); cursor: pointer; display: flex; align-items: center; justify-content: center; text-align: center; overflow: hidden; font-variant-numeric: tabular-nums; }
.pp-opt.en { font-size: clamp(15px, 2vw, 22px); line-height: 1.25; }
.pp-opt:hover:not(:disabled) { border-color: var(--pp); }
.pp-opt kbd { position: absolute; top: 3px; left: 8px; font: 800 11px var(--font); color: var(--muted); opacity: .7; }
.pp-opt:disabled { cursor: default; }
.pp-opt.good { background: #bbf7d0; border-color: var(--ok); }
.pp-opt.bad { background: #fecdd3; border-color: var(--bad); }
.pp-opt.kartu { flex-direction: column; gap: 3px; padding-top: 12px; }
.pp-ol { font-size: 13px; color: var(--muted); }
.pp-tabs { gap: 6px; }
.pp-tabs .opt { min-height: 44px; font-size: clamp(14px, 1.6vw, 18px); border-width: 2px; }

.pp-key { background: #fff; border: 3px solid var(--pp-line); border-radius: 18px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.pp-kdisp { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #fff7ed; border: 3px solid var(--pp); border-radius: 12px; padding: 4px 12px; }
.pp-kdisp-l { font-weight: 800; color: var(--muted); font-size: clamp(12px, 1.4vw, 16px); }
.pp-kdisp b { font: 800 clamp(24px, 4.4vh, 36px)/1.2 var(--font); color: var(--ink); font-variant-numeric: tabular-nums; }
.pp-keys { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.pp-key-b { min-height: 46px; min-width: 44px; border-radius: 12px; border: 0; background: #ffedd5; color: #7c2d12; font: 800 clamp(20px, 3.2vh, 26px) var(--font); cursor: pointer; box-shadow: 0 3px 0 #fdba74; }
.pp-key-b:active { transform: translateY(2px); box-shadow: 0 1px 0 #fdba74; }
.pp-key-b.fn { background: #e0f2fe; color: #075985; box-shadow: 0 3px 0 #7dd3fc; font-size: 20px; }
.pp-key-b:nth-child(12), .pp-key-b:nth-child(13) { grid-column: span 2; }

.pp-tray { background: #fff; border: 3px solid var(--pp-line); border-radius: 18px; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.pp-tsum { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; background: #fff7ed; border: 3px solid var(--pp); border-radius: 12px; padding: 3px 12px; font-weight: 800; color: var(--muted); font-size: clamp(12px, 1.4vw, 16px); }
.pp-tsum b { font: 800 clamp(22px, 4vh, 34px)/1.2 var(--font); color: var(--ink); font-variant-numeric: tabular-nums; }
.pp-chosen { min-height: 54px; border: 3px dashed var(--pp-line); border-radius: 12px; padding: 4px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; justify-content: center; background: #fffbf5; }
.pp-empty { color: var(--muted); font-weight: 700; font-size: 14px; padding: 4px; text-align: center; }
.pp-denoms { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.pp-card { border: 0; background: transparent; padding: 2px; min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; border-radius: 12px; }
.pp-card:hover { background: #fff7ed; }
.pp-card:active { transform: scale(.94); }
.pp-tact { display: flex; gap: 8px; justify-content: center; }
.pp-tact .opt { min-height: 44px; font-size: 16px; border-width: 2px; }

.pp-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(92px, 12vw, 120px), 1fr)); gap: 8px; }
.pp-pick { width: auto; position: relative; cursor: pointer; border-color: var(--pp-line); min-height: 44px; }
.pp-pick[aria-pressed="true"] { background: #dcfce7; border-color: var(--ok); }
.pp-pick[aria-pressed="true"]::after { content: "\2713"; position: absolute; top: 4px; left: 6px; width: 22px; height: 22px; border-radius: 50%; background: var(--ok); color: #fff; font: 800 14px/22px var(--font); }
.pp-pick:disabled { cursor: default; }
.pp-pick.good { background: #bbf7d0; border-color: var(--ok); }
.pp-pick.bad { background: #fecdd3; border-color: var(--bad); }

.pp-fb { text-align: left; font-weight: 700; color: var(--muted); font-size: clamp(13px, 1.6vw, 18px); line-height: 1.4; border-radius: 14px; padding: 6px 12px; }
.pp-fb.ok { background: #dcfce7; color: #14532d; } .pp-fb.bad { background: #ffe4e6; color: #881337; }
.pp-pemb { display: block; margin-top: 2px; font-weight: 600; }
.pp-btns { display: flex; gap: 10px; justify-content: center; }
.pp-btns .primary { margin-top: 0; min-height: 52px; padding: 0 30px; font-size: clamp(18px, 2.2vw, 24px); }

/* mode Ekonomi (IPAS): pilihan panjang dan soal mencocokkan */
.pp-opt.long { font-size: clamp(15px, 2vw, 22px); line-height: 1.25; text-wrap: balance; }
.pp-picks.pp-match { display: flex; flex-direction: column; gap: 8px; }
.pp-mrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; background: #fff; border: 3px solid var(--pp-line); border-radius: 16px; padding: 6px 10px; }
.pp-mrow.good { background: #bbf7d0; border-color: var(--ok); } .pp-mrow.bad { background: #fecdd3; border-color: var(--bad); }
.pp-ml { flex: 1 1 140px; display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--ink); font-size: clamp(14px, 1.6vw, 18px); line-height: 1.25; min-width: 0; overflow-wrap: anywhere; }
.pp-ml img { width: 36px; height: 36px; flex: none; }
.pp-mc { flex: 1 1 150px; display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; min-width: 0; }
.pp-cho { min-height: 44px; min-width: 44px; padding: 4px 12px; border: 3px solid var(--pp-line); background: #fff7ed; color: var(--ink); border-radius: 12px; font: 800 clamp(14px, 1.6vw, 17px)/1.2 var(--font); cursor: pointer; }
.pp-cho[aria-pressed="true"] { background: #fed7aa; border-color: var(--pp); }
.pp-cho:disabled, .pp-sel:disabled { cursor: default; }
.pp-sel { min-height: 44px; max-width: 100%; width: 100%; padding: 4px 8px; border: 3px solid var(--pp-line); border-radius: 12px; background: #fff; color: var(--ink); font: 700 clamp(14px, 1.6vw, 17px) var(--font); }

/* uang mainan */
.pp-coin, .pp-note { position: relative; display: inline-grid; place-items: center; flex: none; color: #0f172a; font-family: var(--font); line-height: 1; user-select: none; }
.pp-coin { width: 54px; height: 54px; border-radius: 50%; box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .6), inset 0 -4px 0 rgba(0, 0, 0, .16), 0 3px 0 rgba(0, 0, 0, .2); align-content: center; }
.pp-coin .rp { font-size: 8px; font-weight: 800; opacity: .8; margin-bottom: -2px; }
.pp-coin .n { font-size: 15px; font-weight: 800; letter-spacing: -.02em; }
.pp-coin .m { position: absolute; bottom: 7px; left: 0; right: 0; text-align: center; font-size: 4.5px; font-weight: 800; letter-spacing: .04em; opacity: .75; }
.pp-coin.c100 { width: 48px; height: 48px; background: radial-gradient(circle at 35% 30%, #fdba74, #c2410c); color: #fff; }
.pp-coin.c200 { width: 51px; height: 51px; background: radial-gradient(circle at 35% 30%, #f8fafc, #94a3b8); }
.pp-coin.c500 { width: 56px; height: 56px; background: radial-gradient(circle at 35% 30%, #fef9c3, #ca8a04); }
.pp-coin.c1000 { width: 60px; height: 60px; background: radial-gradient(circle, #e2e8f0 0 52%, #eab308 54% 100%); }
.pp-note { width: 96px; height: 48px; border-radius: 8px; overflow: hidden; border: 2px solid rgba(255, 255, 255, .85); box-shadow: 0 0 0 1px rgba(15, 23, 42, .22), 0 3px 0 rgba(15, 23, 42, .18); background-color: var(--nb, #e2e8f0); background-image: radial-gradient(circle at 12% 50%, rgba(255, 255, 255, .55) 0 7px, transparent 8px), radial-gradient(circle at 88% 50%, rgba(255, 255, 255, .55) 0 7px, transparent 8px), repeating-linear-gradient(135deg, rgba(255, 255, 255, .28) 0 4px, transparent 4px 9px); }
.pp-note .big { position: relative; z-index: 1; font-size: 15px; font-weight: 800; background: rgba(255, 255, 255, .82); border-radius: 6px; padding: 3px 7px; font-variant-numeric: tabular-nums; }
.pp-note .cr { position: absolute; font-size: 7.5px; font-weight: 800; z-index: 1; }
.pp-note .tl { top: 2px; left: 4px; } .pp-note .br { display: none; }
.pp-note.n10000 .big, .pp-note.n20000 .big, .pp-note.n50000 .big, .pp-note.n100000 .big { font-size: 13px; padding: 3px 5px; }
.pp-note .m { position: absolute; bottom: 2px; left: 0; right: 0; text-align: center; font-size: 5px; font-weight: 800; letter-spacing: .1em; opacity: .75; }
.pp-note.n1000 { --nb: #bef264; } .pp-note.n2000 { --nb: #5eead4; } .pp-note.n5000 { --nb: #fdba74; } .pp-note.n10000 { --nb: #c4b5fd; }
.pp-note.n20000 { --nb: #86efac; } .pp-note.n50000 { --nb: #7dd3fc; } .pp-note.n100000 { --nb: #fda4af; }
.pp-pc.sm .pp-coin, .sm .pp-coin { transform: scale(.8); margin: -5px; }
.pp-pc.sm .pp-note, .sm .pp-note { transform: scale(.8); margin: -5px -9px; }

/* pengaturan dan hasil */
.pp-stall { display: block; width: min(300px, 70%); height: auto; margin: 0 auto 2px; }
.pp-names { display: grid; gap: 6px; }
.pp-names input { font: 700 16px var(--font); padding: 8px 14px; border: 2px solid var(--line); border-radius: 999px; min-width: 0; width: 100%; text-align: center; min-height: 44px; }
.pp-names input[hidden] { display: none; }
.options.is-off { opacity: .45; pointer-events: none; }
.pp-recap { display: flex; flex-direction: column; gap: 4px; font-size: clamp(15px, 2vw, 22px); margin-bottom: 6px; }
.pp-salah { text-align: left; margin: 6px 0; }
.pp-salah h3 { margin: 6px 0; text-align: center; }
.pp-allok { text-align: center; font-weight: 800; color: var(--ok); font-size: clamp(16px, 2.2vw, 24px); }
.pp-wl { margin: 0; padding-left: 1.4em; display: grid; gap: 8px; }
.pp-wl li { background: #fff7ed; border: 2px solid var(--pp-line); border-radius: 14px; padding: 6px 12px; color: var(--ink); font-size: clamp(13px, 1.5vw, 16px); line-height: 1.4; }
.pp-wl .q { font-weight: 700; } .pp-wl small { display: block; color: var(--muted); font-weight: 800; }
.pp-wl .t { color: #1e3a8a; font-size: .95em; } .pp-wl .a b { color: var(--ok); } .pp-wl .p { color: var(--muted); }

/* layar lebar atau HP mendatar: cerita di kiri, jawaban di kanan */
@media (orientation: landscape) and (min-width: 640px) {
  .pp-split { flex-direction: row; align-items: stretch; flex: 1 1 0; }
  .pp-left { flex: 1 1 48%; overflow-y: auto; overflow-x: hidden; padding: 2px; min-height: 0; }
  .pp-right { flex: 1 1 52%; overflow-y: auto; overflow-x: hidden; padding: 2px; min-height: 0; }
}
@media (max-width: 420px) {
  .pp-note { width: 84px; } .pp-bub { max-width: 100%; }
  .pp-keys { gap: 4px; }
}
@media (max-height: 520px) {
  .pp .iconbtn { min-height: 44px; min-width: 44px; }
  .pp .iconbtn.ic { width: 44px; }
  .pp-stall, .pp-ask { display: none; }
  .pp-chip { padding: 0 10px; font-size: 13px; }
  .pp-wrap { gap: 4px; padding: 4px 8px; }
  .pp-awning { height: 14px; }
  .pp-story { padding: 4px 10px; font-size: 14px; border-width: 2px; }
  .pp-bub { font-size: 15px; padding: 3px 10px 5px; }
  .pp-trans { font-size: 13px; padding: 4px 10px; }
  .pp-item, .pp-pick { width: 84px; padding: 3px 2px; }
  .pp-em img { width: 32px; height: 32px; }
  .pp-opt { min-height: 46px; font-size: 20px; border-width: 3px; }
  .pp-opt.en, .pp-opt.long { font-size: 14px; }
  .pp-key { padding: 4px; gap: 4px; } .pp-kdisp b { font-size: 24px; }
  .pp-key-b { min-height: 44px; font-size: 20px; }
  .pp-tray { padding: 4px; gap: 4px; }
  .pp-btns .primary { min-height: 46px; font-size: 18px; }
  .pp-fb { font-size: 12.5px; padding: 3px 8px; }
  .pp-receipt { padding: 4px 10px; font-size: 12.5px; }
  .pp-cash { padding: 3px 6px; }
}
.pp .rotate-hint button { min-height: 44px; min-width: 64px; }
