/* Floralia — ร้านแพ็ก (the cart shop, 2026-10-17: js/packshop.js, G.overlay 'pack'). Full screen in the HUD's obsidian + gold,
   like the diamond shop beside it (css/diashop.css), so it reads the same over every book skin. MIR4 layout: the six
   categories down the left, the pack cards in a grid. Numbers crisp, no soft glow round text (a 1px dark ring at most). */
#packshop { position: fixed; inset: 0; z-index: 900; pointer-events: auto; overflow: hidden; user-select: none; font-family: 'Mali', sans-serif; color: #f2ead6;
  background: radial-gradient(ellipse 80% 70% at 58% 42%, #2a2116 0%, #17130f 58%, #0b0a0d 100%); animation: pkIn 0.2s ease-out both; }
@keyframes pkIn { from { opacity: 0; } to { opacity: 1; } }
#packshop[hidden], #packshop [hidden] { display: none !important; }
#packshop button { font-family: 'Mali', sans-serif; color: inherit; }
#packshop .pk-stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; display: flex; flex-direction: column; }

/* ---- top bar: the cart and the title · the money · exit */
#packshop .pk-top { position: relative; flex: none; height: 66px; display: flex; align-items: center; gap: 18px; padding: 0 14px 0 18px;
  background: linear-gradient(#0b0a0e, #1b1712); border-bottom: 1px solid rgba(217, 164, 67, 0.5); }
#packshop .pk-title { display: flex; align-items: center; gap: 10px; flex: none; }
#packshop .pk-title img { width: 44px; height: 44px; object-fit: contain; }
#packshop .pk-title b { font: 800 27px/1 Mali, sans-serif; color: #f4dfa8; letter-spacing: 0.5px; }
#packshop .pk-title small { align-self: flex-end; margin-bottom: 4px; font: 600 14px Mali, sans-serif; color: #b9a983; }
#packshop .pk-cur { margin-left: auto; display: flex; align-items: center; gap: 8px; }
#packshop .pk-chip { display: flex; align-items: center; gap: 6px; height: 34px; min-width: 110px; padding: 0 12px 0 6px; border-radius: 6px; background: #0a090c; box-shadow: inset 0 0 0 1px rgba(217, 164, 67, 0.45); cursor: pointer; }
#packshop .pk-chip:hover, #packshop .pk-chip:focus-visible { box-shadow: inset 0 0 0 1px #f2c66a; }
#packshop .pk-chip img { width: 26px; height: 26px; object-fit: contain; }
#packshop .pk-chip em { margin-left: auto; font: 700 17px Fredoka, Mali, sans-serif; font-style: normal; font-variant-numeric: tabular-nums; }
#packshop .pk-chip.pk-dia em { color: #a8ecff; }
#packshop .pk-chip.pk-bs em { color: #ddd2ff; }
#packshop .pk-plus { width: 28px; height: 28px; margin-left: -4px; padding: 0; border-radius: 50%; border: 1px solid #f4cf75; background: linear-gradient(#5cc25a, #24742a); color: #fff; font: 800 19px/1 Fredoka, sans-serif; cursor: pointer; }
#packshop .pk-plus:hover, #packshop .pk-plus:focus-visible { filter: brightness(1.15); }
#packshop .pk-exit { flex: none; width: 46px; height: 46px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; }
#packshop .pk-exit i { width: 38px; height: 38px; background: var(--uib-btn_close, url(../assets/ui_book/btn_close.png)) center / contain no-repeat; transition: transform 0.12s, filter 0.12s; }
#packshop .pk-exit:hover i, #packshop .pk-exit:focus-visible i { transform: scale(1.1); filter: brightness(1.2); }

/* ---- the categories down the left */
#packshop .pk-main { flex: 1; min-height: 0; display: flex; }
#packshop .pk-tabs { flex: none; width: 244px; display: flex; flex-direction: column; gap: 6px; padding: 14px 10px 14px 14px; overflow-y: auto;
  background: linear-gradient(90deg, rgba(10, 9, 12, 0.9), rgba(10, 9, 12, 0.55)); border-right: 1px solid rgba(217, 164, 67, 0.28); }
#packshop .pk-tabs button { position: relative; display: flex; align-items: center; gap: 10px; min-height: 66px; padding: 6px 12px 6px 8px; border: 0; border-radius: 12px; cursor: pointer; text-align: left;
  background: rgba(255, 255, 255, 0.03); box-shadow: inset 0 0 0 1px rgba(217, 164, 67, 0.2); color: #c3b596; font: 700 16.5px/1.2 Mali, sans-serif; white-space: nowrap; }
#packshop .pk-tabs button img { flex: none; width: 50px; height: 50px; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.5)); }
#packshop .pk-tabs button:hover, #packshop .pk-tabs button:focus-visible { color: #f2dfae; background: rgba(217, 164, 67, 0.09); }
#packshop .pk-tabs button.on { color: #2a1a06; background: linear-gradient(#f6d684, #c9912f); box-shadow: inset 0 0 0 1px #ffe9a8, 0 4px 12px rgba(0, 0, 0, 0.4); }
#packshop .pk-dot { position: absolute; right: 8px; top: 8px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: #e2402f; box-shadow: 0 0 0 2px #1a1310;
  color: #fff; font: 700 12px/20px Fredoka, Mali, sans-serif; font-style: normal; text-align: center; }
#packshop .pk-dot.n { background: #2f88c4; }

/* ---- the page: a header strip, then the cards */
#packshop .pk-body { position: relative; flex: 1; min-width: 0; overflow-y: auto; padding: 16px 24px 24px; }
#packshop .pk-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; padding: 10px 18px 10px 12px; border-radius: 14px;
  background: linear-gradient(90deg, rgba(217, 164, 67, 0.2), rgba(217, 164, 67, 0.04) 70%); box-shadow: inset 0 0 0 1px rgba(242, 198, 106, 0.4); }
#packshop .pk-hart { position: relative; flex: none; width: 64px; height: 64px; }
#packshop .pk-head > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
#packshop .pk-head b { font: 800 24px/1.2 Mali, sans-serif; color: #ffe9b0; }
#packshop .pk-head small { font: 500 14px/1.45 Mali, sans-serif; color: #cdbf9f; }
#packshop .pk-reset { margin-left: auto; flex: none; padding: 7px 14px; border-radius: 10px; background: #0d0b10; box-shadow: inset 0 0 0 1px rgba(217, 164, 67, 0.45); font: 600 15px Mali, sans-serif; color: #d9cba8; }
#packshop .pk-reset b { font: 700 17px Fredoka, Mali, sans-serif; color: #ffe08a; font-variant-numeric: tabular-nums; }
#packshop .pk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; align-items: stretch; }
#packshop .pk-none { grid-column: 1 / -1; color: #a39a86; text-align: center; }
#packshop .pk-foot { margin: 18px 0 0; font: 500 13.5px/1.6 Mali, sans-serif; color: #9d937e; }
#packshop .pk-link { padding: 0 4px; border: 0; background: none; color: #f2c66a; font: 700 14px Mali, sans-serif; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
#packshop .pk-link:hover { color: #ffe3a1; }

/* ---- a pack card */
#packshop .pk-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 34px 14px 14px; border-radius: 16px; text-align: center; cursor: pointer; overflow: hidden;
  background: linear-gradient(#2a231b, #18140f); box-shadow: inset 0 0 0 1px rgba(217, 164, 67, 0.4), 0 6px 16px rgba(0, 0, 0, 0.4); transition: transform 0.12s, box-shadow 0.12s; }
#packshop .pk-card:hover, #packshop .pk-card:focus-visible { transform: translateY(-3px); box-shadow: inset 0 0 0 2px #f2c66a, 0 10px 24px rgba(0, 0, 0, 0.5); outline: none; }
#packshop .pk-card.is-free { background: linear-gradient(#2b2a17, #17160d); }
#packshop .pk-card.k-free, #packshop .pk-card.k-claim { box-shadow: inset 0 0 0 2px #9be37b, 0 6px 18px rgba(0, 0, 0, 0.4); animation: pkReady 1.6s ease-in-out infinite; }
@keyframes pkReady { 50% { box-shadow: inset 0 0 0 2px #d9ffc4, 0 6px 22px rgba(155, 227, 123, 0.28); } }
@media (prefers-reduced-motion: reduce) { #packshop .pk-card.k-free, #packshop .pk-card.k-claim { animation: none; } }
#packshop .pk-card.is-pass { background: linear-gradient(#33281a, #1b150d); }
#packshop .pk-card.k-sold, #packshop .pk-card.k-lock, #packshop .pk-card.k-soon { filter: saturate(0.55); }
#packshop .pk-card.k-sold > :not(.pk-stamp):not(.pk-buy):not(.pk-meta), #packshop .pk-card.k-lock .pk-art, #packshop .pk-card.k-soon .pk-art { opacity: 0.6; }
#packshop .pk-ribs { position: absolute; left: 0; top: 10px; right: 0; display: flex; gap: 4px; padding: 0 10px; pointer-events: none; }
#packshop .pk-rib { padding: 3px 10px; border-radius: 8px; font: 700 13px/1.3 Mali, sans-serif; font-style: normal; color: #fff; white-space: nowrap; }
#packshop .pk-rib.val { background: linear-gradient(#ff6a5a, #c3302a); }
#packshop .pk-rib.free { background: linear-gradient(#6fcf54, #2f8a2a); }
#packshop .pk-rib.hot { margin-left: auto; background: linear-gradient(#f6d684, #c9912f); color: #2a1a06; }
#packshop .pk-rib.new { background: linear-gradient(#45a6e6, #1d6aa6); }
#packshop .pk-rib.val + .pk-rib.new, #packshop .pk-rib.free + .pk-rib.new { margin-left: auto; }
#packshop .pk-rib.hot + .pk-rib.new { margin-left: 0; }
#packshop .pk-art { position: relative; flex: none; width: 156px; height: 118px; background: radial-gradient(circle at 50% 58%, rgba(255, 214, 120, 0.26), rgba(255, 214, 120, 0) 64%); }
#packshop .pk-art img, #packshop .pk-hart img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5)); }
#packshop .pk-art.sm { width: 96px; height: 84px; flex: none; }
#packshop .pk-nm { font: 800 18.5px/1.25 Mali, sans-serif; color: #fff0cc; }
#packshop .pk-desc { min-height: 38px; font: 500 12.8px/1.5 Mali, sans-serif; color: #bfb398; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#packshop .pk-items, #packshop .pk-daily { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; }
#packshop .pk-items { min-height: 50px; }
#packshop .pk-it { position: relative; display: inline-flex; cursor: pointer; border-radius: 8px; }
#packshop .pk-it .tslot { width: 50px; height: 50px; }
#packshop .pk-it:hover, #packshop .pk-it:focus-visible { filter: brightness(1.15); outline: none; transform: translateY(-1px); }
#packshop .pk-n { position: absolute; z-index: 3; right: 2px; bottom: 2px; padding: 0 4px; border-radius: 5px; background: rgba(8, 7, 10, 0.88); color: #fff; font: 700 11.5px/1.45 Fredoka, Mali, sans-serif; font-style: normal; font-variant-numeric: tabular-nums; }
#packshop .pk-more { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 9px; background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 0 0 1px rgba(217, 164, 67, 0.4); color: #f2dfae; font: 800 16px Fredoka, sans-serif; }
#packshop .pk-daily { align-items: center; padding: 6px 8px; border-radius: 12px; background: rgba(155, 227, 123, 0.07); box-shadow: inset 0 0 0 1px rgba(155, 227, 123, 0.35); }
#packshop .pk-daily > i { padding: 2px 8px; border-radius: 7px; background: #1f5a2a; color: #e6ffd9; font: 700 12.5px/1.4 Mali, sans-serif; font-style: normal; }
#packshop .pk-meta { margin-top: auto; width: 100%; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px 12px; padding-top: 4px; font: 600 13px/1.3 Mali, sans-serif; }
#packshop .pk-lim { color: #9fd7a0; }
#packshop .pk-lim.full { color: #ff9a8a; }
#packshop .pk-lim.on { padding: 1px 10px; border-radius: 8px; background: #1f5a2a; color: #e6ffd9; }
#packshop .pk-cd { color: #d9cba8; }
#packshop .pk-cd b { color: #ffe08a; font: 700 13.5px Fredoka, Mali, sans-serif; font-variant-numeric: tabular-nums; }
#packshop .pk-cd.ev b { color: #ffb48a; }
#packshop .pk-cd.soon { color: #8fd0ff; }
#packshop .pk-buy { width: 100%; display: flex; align-items: center; justify-content: center; gap: 6px; height: 44px; border: 0; border-radius: 11px; cursor: pointer;
  background: linear-gradient(#2f88c4, #1a5a8c); color: #f0fbff; box-shadow: inset 0 0 0 1px #7fe3ff; font: 800 20px/1 Fredoka, Mali, sans-serif; font-variant-numeric: tabular-nums; }
#packshop .pk-buy img { width: 26px; height: 26px; object-fit: contain; }
#packshop .pk-buy small { margin-left: 4px; font: 700 13px Mali, sans-serif; }
#packshop .pk-buy .pk-btxt { font: 800 17px/1 Mali, sans-serif; }
#packshop .pk-buy.b-free, #packshop .pk-buy.b-claim { background: linear-gradient(#8ee06b, #2f8a2a); color: #fff; box-shadow: inset 0 0 0 1px #d9ffc4; }
#packshop .pk-buy:hover:not(:disabled), #packshop .pk-buy:focus-visible { filter: brightness(1.15); }
#packshop .pk-buy:disabled { cursor: default; background: #2a2620; box-shadow: inset 0 0 0 1px rgba(217, 164, 67, 0.3); color: #b5aa92; }
#packshop .pk-stamp { position: absolute; left: 50%; top: 92px; transform: translateX(-50%) rotate(-12deg); padding: 4px 16px; border: 3px solid #e2402f; border-radius: 10px;
  background: rgba(20, 12, 10, 0.75); color: #ff8a7a; font: 800 24px/1.1 Mali, sans-serif; font-style: normal; letter-spacing: 1px; white-space: nowrap; pointer-events: none; }

/* ---- pop-ups: confirm, the monthly card, the result */
#packshop .pk-pop { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; background: rgba(5, 4, 8, 0.62); }
#packshop .pk-pin { position: relative; width: 600px; max-width: calc(100% - 24px); max-height: calc(100% - 30px); overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 20px 22px; border-radius: 16px;
  background: linear-gradient(#2a241d, #17140f); box-shadow: inset 0 0 0 2px rgba(242, 198, 106, 0.75), 0 18px 46px rgba(0, 0, 0, 0.6); }
#packshop .pk-pin h4 { margin: 0; padding-right: 36px; font: 800 22px/1.25 Mali, sans-serif; color: #ffe9b0; }
#packshop .pk-pin h5 { margin: 4px 0 0; font: 800 16px/1.3 Mali, sans-serif; color: #f2dfae; }
#packshop .pk-pin h5 small { margin-left: 6px; font: 500 12.5px Mali, sans-serif; color: #a39a86; }
#packshop .pk-px { position: absolute; right: 12px; top: 12px; width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid rgba(217, 164, 67, 0.8); background: #1c160e; color: #ffd98a; font: 700 14px/1 sans-serif; cursor: pointer; }
#packshop .pk-phead { display: flex; align-items: center; gap: 14px; padding-right: 30px; }
#packshop .pk-phead > span:last-child { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; min-width: 0; }
#packshop .pk-phead b { font: 800 21px/1.3 Mali, sans-serif; color: #fff0cc; }
#packshop .pk-phead small { font: 500 13.5px/1.5 Mali, sans-serif; color: #c4b89c; }
#packshop .pk-plist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
#packshop .pk-prow { display: flex; align-items: center; gap: 10px; padding: 4px 10px 4px 4px; border-radius: 10px; background: rgba(255, 255, 255, 0.04); box-shadow: inset 0 0 0 1px rgba(217, 164, 67, 0.25); cursor: pointer; min-width: 0; }
#packshop .pk-prow:hover, #packshop .pk-prow:focus-visible { box-shadow: inset 0 0 0 1px #f2c66a; outline: none; }
#packshop .pk-prow .tslot { width: 46px; height: 46px; }
#packshop .pk-prow b { flex: 1; min-width: 0; font: 700 14px/1.3 Mali, sans-serif; color: #f6ead0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#packshop .pk-prow em { font: 700 15px Fredoka, Mali, sans-serif; font-style: normal; color: #ffe08a; font-variant-numeric: tabular-nums; }
#packshop .pk-plim { display: flex; gap: 12px; justify-content: center; font: 600 13.5px Mali, sans-serif; }
#packshop .pk-total { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px; background: #0d0b10; box-shadow: inset 0 0 0 1px rgba(217, 164, 67, 0.35); }
#packshop .pk-total span { font: 600 15px Mali, sans-serif; color: #cfc6b2; }
#packshop .pk-total b { display: flex; align-items: center; gap: 6px; font: 800 24px Fredoka, Mali, sans-serif; color: #a8ecff; }
#packshop .pk-total b img { width: 26px; height: 26px; }
#packshop .pk-total b.short { color: #ff8a7a; }
#packshop .pk-total small { margin-left: auto; font: 500 13px Mali, sans-serif; color: #a39a86; }
#packshop .pk-why { margin: 0; font: 600 14px/1.5 Mali, sans-serif; color: #ff9a8a; }
#packshop .pk-pbtns { display: flex; gap: 10px; justify-content: flex-end; }
#packshop .pk-pbtns button { min-width: 120px; height: 46px; padding: 0 18px; border: 0; border-radius: 10px; cursor: pointer; font: 800 17px Mali, sans-serif; }
#packshop .pk-cancel { background: rgba(255, 255, 255, 0.07); box-shadow: inset 0 0 0 1px rgba(217, 164, 67, 0.4); color: #e6dcc4; }
#packshop .pk-ok { background: linear-gradient(#f4cf75, #c8902f); color: #2a1a06; }
#packshop .pk-ok.alt { background: linear-gradient(#8ee06b, #2f8a2a); color: #fff; }
#packshop .pk-pbtns button:hover:not(:disabled), #packshop .pk-pbtns button:focus-visible { filter: brightness(1.12); }
#packshop .pk-pbtns button:disabled { opacity: 0.5; cursor: default; }
#packshop .pk-got { margin: 0; padding: 0 0 0 20px; display: flex; flex-direction: column; gap: 4px; font: 600 15px/1.5 Mali, sans-serif; color: #f2ead6; }
#packshop .pk-got:empty { display: none; }
#packshop .pk-prize { display: flex; flex-direction: column; align-items: center; gap: 6px; }
#packshop .pk-prize img { max-width: 220px; max-height: 220px; object-fit: contain; }
#packshop .pk-prize b { font: 800 18px Mali, sans-serif; }
#packshop .pk-say { position: absolute; left: 50%; top: 84px; transform: translateX(-50%); z-index: 6; padding: 10px 22px; border-radius: 10px; background: rgba(10, 9, 12, 0.95); box-shadow: inset 0 0 0 1px #f2c66a;
  font: 700 16px/1.4 Mali, sans-serif; color: #ffe9b0; pointer-events: none; white-space: nowrap; }
#packshop .pk-say.in { animation: pkSay 0.25s ease-out both; }
@keyframes pkSay { from { opacity: 0; transform: translate(-50%, -6px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---- a phone: the categories become a row under the top bar, the cards one or two across */
#packshop.pk-narrow .pk-top { height: auto; flex-wrap: wrap; gap: 6px; padding: 8px 52px 8px 10px; }
#packshop.pk-narrow .pk-title img { width: 34px; height: 34px; }
#packshop.pk-narrow .pk-title b { font-size: 21px; }
#packshop.pk-narrow .pk-title small { display: none; }
#packshop.pk-narrow .pk-cur { gap: 4px; }
#packshop.pk-narrow .pk-chip { min-width: 0; height: 30px; }
#packshop.pk-narrow .pk-exit { position: absolute; right: 4px; top: 6px; width: 42px; height: 42px; }
#packshop.pk-narrow .pk-main { flex-direction: column; }
#packshop.pk-narrow .pk-tabs { width: auto; flex-direction: row; gap: 4px; padding: 6px 8px; overflow-x: auto; overflow-y: hidden; border-right: 0; border-bottom: 1px solid rgba(217, 164, 67, 0.28); scrollbar-width: none; }
#packshop.pk-narrow .pk-tabs::-webkit-scrollbar { display: none; }
#packshop.pk-narrow .pk-tabs button { flex: none; flex-direction: column; gap: 2px; min-height: 0; padding: 4px 10px 5px; font-size: 13px; text-align: center; white-space: nowrap; }
#packshop.pk-narrow .pk-tabs button img { width: 32px; height: 32px; }
#packshop.pk-narrow .pk-dot { right: 2px; top: 2px; }
#packshop.pk-narrow .pk-body { padding: 10px 10px 18px; }
#packshop.pk-narrow .pk-head { flex-wrap: wrap; gap: 8px; padding: 8px 10px; }
#packshop.pk-narrow .pk-hart { width: 46px; height: 46px; }
#packshop.pk-narrow .pk-head > div { flex: 1; }
#packshop.pk-narrow .pk-head b { font-size: 19px; }
#packshop.pk-narrow .pk-head small { font-size: 12.5px; }
#packshop.pk-narrow .pk-reset { margin-left: 0; width: 100%; text-align: center; }
#packshop.pk-narrow .pk-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
#packshop.pk-narrow .pk-card { padding: 30px 8px 10px; }
#packshop.pk-narrow .pk-art { width: 120px; height: 90px; }
#packshop.pk-narrow .pk-nm { font-size: 16px; }
#packshop.pk-narrow .pk-it .tslot, #packshop.pk-narrow .pk-more { width: 42px; height: 42px; }
#packshop.pk-narrow .pk-rib { padding: 2px 7px; font-size: 11.5px; }
#packshop.pk-narrow .pk-stamp { top: 72px; font-size: 20px; }
#packshop.pk-narrow .pk-plist { grid-template-columns: 1fr; }
#packshop.pk-narrow .pk-say { white-space: normal; width: 90%; text-align: center; }
