/* Thida TopUp - purchase flow (workstream B): game page, package cards, payment, order summary, KHQR modal,
   duplicate-order dialog, invoice / payment result, order lookup, account pages, wallet.
   Colours ONLY from thida-tokens.css (--th-*). Exception: the official KHQR card inside #bakongModal keeps the KHQR brand
   colours (white card, red header, navy text) so the payment card stays recognisable - same rule as SVG gradient stops.
   Loaded by B's views with @push('head') (after purchase-pages.css). Selectors are scoped (.tp-buy / ids) and some use
   !important only where an older global rule (design-system.css, Tailwind utilities toggled by game-show.js) also does. */

/* ---------- 0. local aliases ---------- */
:root, html[data-theme="dark"] {
  --thb-soft: color-mix(in srgb, var(--th-pink) 12%, transparent);
  --thb-soft-2: color-mix(in srgb, var(--th-pink) 20%, transparent);
  --thb-ring: color-mix(in srgb, var(--th-pink) 55%, transparent);
  --thb-purple-soft: color-mix(in srgb, var(--th-purple) 14%, transparent);
  --thb-ok-soft: color-mix(in srgb, var(--th-success) 14%, transparent);
  --thb-err-soft: color-mix(in srgb, var(--th-error) 14%, transparent);
  --thb-warn-soft: color-mix(in srgb, var(--th-warning) 16%, transparent);
  --thb-logo-bg: var(--th-text);            /* near-white tile for payment logos in dark */
  --thb-input-bg: var(--th-bg-2);
  --thb-buybar-h: 72px;
}
html[data-theme="light"] {
  --thb-logo-bg: var(--th-card);
  --thb-input-bg: var(--th-card);
}

/* ---------- 1. page shell ---------- */
.tp-buy {
  color: var(--th-text);
  font-family: var(--th-font);
  padding: 16px 0 32px;
  line-height: 1.5;
}
html[lang="km"] .tp-buy, html[lang="km"] .tp-buybar, html[lang="km"] .tp-khqr, html[lang="km"] .tp-modal { line-height: 1.6; }
/* Khmer never clips: every text element in B pages gets >= 1.6 (beats the tighter English line-heights below) */
html[lang="km"] :is(.tp-buy, .tp-buybar, .tp-khqr, .tp-modal, #notification) :is(h1, h2, h3, p, span, a, button, label, dt, dd, li, strong, input, select) { line-height: 1.6; }
.tp-buy *, .tp-buybar *, .tp-khqr *, .tp-modal * { box-sizing: border-box; }
.tp-wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .tp-buy { padding-top: 24px; } .tp-wrap { padding: 0 24px; } }

.tp-card {
  background: var(--th-card);
  border: 1px solid var(--th-border);
  border-radius: 16px;
  box-shadow: var(--th-shadow);
  min-width: 0;
}
.tp-buy h1, .tp-buy h2, .tp-buy h3, .tp-buy p { margin: 0; }
.tp-money { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; white-space: nowrap; }
.tp-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tp-buy .hidden, .tp-buybar .hidden, .tp-khqr-expired.hidden, .tp-modal.hidden, .tp-toast.hidden { display: none !important; }

/* game page grid: main (header + steps 1-2) | side (payment + summary) */
.tp-gp-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.tp-gp-main, .tp-gp-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
@media (min-width: 1024px) {
  .tp-gp-grid { grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
  .tp-gp-main, .tp-gp-side { gap: 16px; }
  .tp-gp-side { align-self: stretch; }
}
@media (min-width: 1280px) { .tp-gp-grid { grid-template-columns: minmax(0, 1fr) 380px; } }

/* ---------- 2. buttons, inputs, links ---------- */
.tp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border: 1px solid transparent; border-radius: 12px;
  font: inherit; font-size: 15px; font-weight: 700; line-height: 1.3;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform var(--th-dur-fast) var(--th-ease), opacity var(--th-dur) var(--th-ease), box-shadow var(--th-dur) var(--th-ease), background-color var(--th-dur) var(--th-ease);
  -webkit-tap-highlight-color: transparent;
}
.tp-btn--block { width: 100%; }
.tp-btn--primary { background: var(--th-btn); background-image: var(--th-grad); color: var(--th-btn-text); box-shadow: var(--th-shadow-pink); }
.tp-btn--soft { background: var(--thb-soft); color: var(--th-pink); border-color: var(--thb-soft-2); }
.tp-btn--ghost { background: transparent; color: var(--th-text-2); border-color: var(--th-border); }
@media (hover: hover) {
  .tp-btn--primary:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 12px 30px -10px var(--thb-ring); }
  .tp-btn--soft:not(:disabled):hover { background: var(--thb-soft-2); }
  .tp-btn--ghost:hover { border-color: var(--th-border-strong); color: var(--th-text); }
}
.tp-btn:not(:disabled):active { transform: scale(.98); }
.tp-btn:disabled { cursor: not-allowed; }
.tp-btn:focus-visible, .tp-icon-btn:focus-visible, .tp-pkg:focus-visible, .tp-pay:focus-visible, .tp-link-btn:focus-visible, .tp-game-more:focus-visible, .tp-step-help:focus-visible {
  outline: 2px solid var(--th-pink); outline-offset: 2px;
}
.tp-btn .animate-spin, .tp-buy-btn .animate-spin { border-color: currentColor !important; border-top-color: transparent !important; }

.tp-icon-btn {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 36px; height: 36px; padding: 0; border-radius: 10px;
  border: 1px solid var(--th-border); background: var(--th-elev); color: var(--th-text-2);
  cursor: pointer; transition: color var(--th-dur) var(--th-ease), border-color var(--th-dur) var(--th-ease);
}
@media (hover: hover) { .tp-icon-btn:hover { color: var(--th-pink); border-color: var(--thb-ring); } }

.tp-link { color: var(--th-pink); text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }
.tp-link-btn { border: 0; background: none; padding: 0 2px; margin-left: auto; color: var(--th-text-2); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; flex: none; }

.tp-label { display: block; margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--th-text-2); }
.tp-req { color: var(--th-pink); margin-left: 2px; }
.tp-optional { font-weight: 500; color: var(--th-muted); }
.tp-buy .tp-input, .tp-acc .tp-input {
  display: block; width: 100%; min-height: 48px; padding: 10px 14px;
  border: 1px solid var(--th-border-strong) !important; border-radius: 12px;
  background: var(--thb-input-bg) !important; color: var(--th-text) !important;
  font: inherit; font-size: 16px; font-weight: 500;          /* 16px: no zoom on iOS */
  box-shadow: none; outline: none; appearance: none; -webkit-appearance: none;
  transition: border-color var(--th-dur) var(--th-ease), box-shadow var(--th-dur) var(--th-ease);
}
.tp-buy .tp-input::placeholder, .tp-acc .tp-input::placeholder { color: var(--th-muted); opacity: 1; }
.tp-buy .tp-input:focus, .tp-acc .tp-input:focus { border-color: var(--th-pink) !important; box-shadow: 0 0 0 3px var(--thb-soft-2) !important; }
.tp-buy .tp-input:disabled { opacity: .7; }
.tp-buy .tp-select, .tp-acc .tp-select {
  padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, var(--th-text-2) 50%), linear-gradient(135deg, var(--th-text-2) 50%, transparent 50%) !important;
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50% !important;
  background-size: 5px 5px, 5px 5px !important; background-repeat: no-repeat !important;
}
.tp-buy .tp-select option { background: var(--th-card); color: var(--th-text); }
.tp-buy .tp-input.input-error { border-color: var(--th-error) !important; box-shadow: 0 0 0 3px var(--thb-err-soft) !important; }
.tp-buy .error-message { display: none; margin-top: 6px; color: var(--th-error); font-size: 12.5px; font-weight: 500; }
.tp-buy .input-error + .error-message, .tp-buy .error-message:not(:empty) { display: block; }
.tp-buy input:-webkit-autofill { -webkit-text-fill-color: var(--th-text); box-shadow: 0 0 0 1000px var(--thb-input-bg) inset !important; caret-color: var(--th-text); }
.tp-note { margin: 0 0 8px; padding: 10px 12px; border: 1px dashed var(--th-border-strong); border-radius: 12px; color: var(--th-text-2); font-size: 13.5px; }

.tp-check {
  appearance: none; -webkit-appearance: none; flex: none;
  width: 20px; height: 20px; margin: 1px 0 0; border-radius: 6px;
  border: 1.5px solid var(--th-border-strong); background: var(--thb-input-bg);
  display: inline-grid; place-content: center; cursor: pointer;
}
.tp-check::after { content: ""; width: 10px; height: 6px; border: solid var(--th-btn-text); border-width: 0 0 2.4px 2.4px; transform: rotate(-45deg) translate(1px, -1px) scale(0); transition: transform var(--th-dur-fast) var(--th-ease); }
.tp-check:checked { background: var(--th-btn); background-image: var(--th-grad); border-color: transparent; }
.tp-check:checked::after { transform: rotate(-45deg) translate(1px, -1px) scale(1); }
.tp-check:focus-visible { outline: 2px solid var(--th-pink); outline-offset: 2px; }

.tp-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.tp-pill--muted { background: var(--th-elev); color: var(--th-text-2); border: 1px solid var(--th-border); }

/* ---------- 3. game info header ---------- */
.tp-game { position: relative; overflow: hidden; border-radius: 18px; border: 1px solid var(--th-border); background: var(--th-card); box-shadow: var(--th-shadow); isolation: isolate; }
.tp-game-cover { position: absolute; inset: 0 0 auto; height: 100%; max-height: 220px; z-index: -1; overflow: hidden; }
.tp-game-cover img { width: 100%; height: 100%; object-fit: cover; opacity: .38; filter: saturate(1.1); }
.tp-game-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, color-mix(in srgb, var(--th-card) 20%, transparent) 0%, var(--th-card) 92%); }
.tp-game::before { content: ""; position: absolute; z-index: -1; right: -60px; top: -80px; width: 260px; height: 220px; background: var(--th-glow); pointer-events: none; }
.tp-game-body { display: flex; gap: 14px; align-items: flex-end; padding: 56px 16px 14px; }
.tp-game-icon { position: relative; flex: none; width: 76px; height: 76px; }
.tp-game-icon > img:first-child, .tp-game-initials { width: 76px; height: 76px; border-radius: 18px; object-fit: cover; display: grid; place-items: center; border: 2px solid var(--th-card); box-shadow: 0 10px 24px -10px var(--thb-ring); background: var(--th-elev); }
.tp-game-initials { font-weight: 800; font-size: 22px; color: var(--th-pink); }
.tp-game-info { min-width: 0; flex: 1; padding-bottom: 2px; }
.tp-game-titlerow { display: flex; align-items: flex-start; gap: 10px; justify-content: space-between; }
.tp-buy .tp-game-title { font-size: 20px; font-weight: 800; line-height: 1.3; color: var(--th-text); overflow-wrap: anywhere; letter-spacing: -.01em; }
.tp-game-pub { margin-top: 2px !important; color: var(--th-text-2); font-size: 13px; }
.tp-facts { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tp-facts li { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; line-height: 1.6; color: var(--th-text-2); background: color-mix(in srgb, var(--th-elev) 80%, transparent); border: 1px solid var(--th-border); }
.tp-facts li svg { color: var(--th-pink); flex: none; }
.tp-game.is-unavailable .tp-game-icon > img:first-child { filter: grayscale(.6); }
.tp-game-details { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--th-dur-slow) var(--th-ease); }
.tp-game-details.is-open { grid-template-rows: 1fr; }
.tp-game-details-in { overflow: hidden; padding: 0 16px; }
.tp-game-details.is-open .tp-game-details-in { padding-bottom: 8px; }
.tp-game-caption { color: var(--th-text); font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.tp-game-caption p { margin: 0; }
.tp-prose { color: var(--th-text-2); font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; }
.tp-prose p { margin: 0 0 8px; }
.tp-prose a { color: var(--th-pink); text-decoration: underline; }
.tp-prose img { max-width: 100%; height: auto; border-radius: 12px; margin: 8px auto; display: block; }
.tp-prose ul, .tp-prose ol { padding-left: 20px; margin: 0 0 8px; }
.tp-prose ul { list-style: disc; } .tp-prose ol { list-style: decimal; }
.tp-game-more {
  display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%;
  min-height: 40px; border: 0; border-top: 1px solid var(--th-border); background: transparent;
  color: var(--th-text-2); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
@media (hover: hover) { .tp-game-more:hover { color: var(--th-pink); } }
@media (min-width: 640px) {
  .tp-game-body { padding: 72px 20px 18px; gap: 18px; }
  .tp-game-icon, .tp-game-icon > img:first-child, .tp-game-initials { width: 96px; height: 96px; border-radius: 22px; }
  .tp-buy .tp-game-title { font-size: 24px; }
  .tp-game-details-in { padding: 0 20px; }
}

/* decoration ("hat") over a cover or package art - never blocks clicks */
.tp-hat { position: absolute; pointer-events: none; width: var(--hat-w, 50%); left: var(--hat-x, 0); top: var(--hat-y, 0); transform: rotate(var(--hat-r, 0deg)); z-index: 2; height: auto; }
.tp-hat.is-float { animation: tp-bob 3.2s ease-in-out infinite; }
@keyframes tp-bob { 0%, 100% { transform: rotate(var(--hat-r, 0deg)) translateY(0); } 50% { transform: rotate(var(--hat-r, 0deg)) translateY(-3px); } }

/* ---------- 4. steps ---------- */
.tp-step-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--th-border); }
.tp-step-num {
  flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px;
  background: var(--th-btn); background-image: var(--th-grad); color: var(--th-btn-text);
  font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; box-shadow: var(--th-shadow-pink);
}
.tp-buy .tp-step-title { font-size: 16px; font-weight: 700; color: var(--th-text); line-height: 1.5; min-width: 0; }
.tp-step-help {
  margin-left: auto; display: inline-flex; align-items: center; gap: 5px; flex: none;
  padding: 4px 10px; min-height: 32px; border-radius: 999px; border: 1px solid var(--th-border);
  background: transparent; color: var(--th-text-2); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
@media (hover: hover) { .tp-step-help:hover { color: var(--th-pink); border-color: var(--thb-ring); } }
.tp-step-body { padding: 14px 16px 16px; }
@media (min-width: 640px) { .tp-step-head { padding: 16px 20px; } .tp-step-body { padding: 16px 20px 20px; } .tp-buy .tp-step-title { font-size: 17px; } }
@media (max-width: 359.98px) { .tp-step-help span { display: none; } }

/* account fields */
.tp-fields { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
.tp-fields.is-2 { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.tp-fields.is-2.is-even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (min-width: 560px) { .tp-fields.is-many { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 359.98px) { .tp-fields.is-2, .tp-fields.is-2.is-even { grid-template-columns: minmax(0, 1fr); } }
.tp-field { min-width: 0; }
.tp-verify-btn { width: 100%; margin-top: 12px; }
.tp-buy #checkUsernameBtn:disabled { opacity: .55; }
.tp-verify { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 10px 12px; border-radius: 12px; font-size: 14px; border: 1px solid; }
.tp-verify--ok { background: var(--thb-ok-soft); border-color: color-mix(in srgb, var(--th-success) 40%, transparent); color: var(--th-text); }
.tp-verify--err { background: var(--thb-err-soft); border-color: color-mix(in srgb, var(--th-error) 40%, transparent); color: var(--th-text); }
.tp-verify-ico { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: var(--th-btn-text); }
.tp-verify--ok .tp-verify-ico { background: var(--th-success); }
.tp-verify--err .tp-verify-ico { background: var(--th-error); }
.tp-verify-text { min-width: 0; overflow-wrap: anywhere; margin: 0; }
.tp-verify--ok strong { color: var(--th-success); font-weight: 700; }

/* recent accounts (game-show.js renderHistoryChips) */
.tp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tp-chips-label { width: 100%; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--th-muted); }
.tp-chip { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; min-height: 32px; padding: 4px 6px 4px 12px; border-radius: 999px; border: 1px dashed var(--th-border-strong); background: var(--th-elev); cursor: pointer; transition: border-color var(--th-dur) var(--th-ease); }
@media (hover: hover) { .tp-chip:hover { border-color: var(--th-pink); } .tp-chip:hover .tp-chip-text { color: var(--th-pink); } }
.tp-chip-text { font-size: 12.5px; font-weight: 600; color: var(--th-text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
.tp-chip-x { display: grid; place-items: center; width: 22px; height: 22px; border: 0; border-radius: 50%; background: transparent; color: var(--th-muted); cursor: pointer; padding: 0; }
.tp-chip-x svg { width: 12px; height: 12px; }
@media (hover: hover) { .tp-chip-x:hover { color: var(--th-error); background: var(--thb-err-soft); } }

/* ---------- 5. packages ---------- */
.tp-pkg-groups { display: flex; flex-direction: column; gap: 18px; }
.tp-buy .tp-pkg-divider { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 13px; font-weight: 700; color: var(--th-text-2); line-height: 1.5; }
.tp-pkg-divider::before, .tp-pkg-divider::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--th-border-strong)); }
.tp-pkg-divider::after { background: linear-gradient(90deg, var(--th-border-strong), transparent); }
.tp-pkg-divider span { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: var(--thb-soft); border: 1px solid var(--thb-soft-2); color: var(--th-pink); max-width: 80%; text-align: center; }
.tp-pkg-divider i { font-size: 12px; }

.tp-pkg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding-top: 6px; }
@media (min-width: 560px) { .tp-pkg-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; } }
@media (min-width: 1024px) { .tp-pkg-grid { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); } }

.tp-buy .tp-pkg {
  position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: center; gap: 8px;
  width: 100%; min-height: 64px; margin: 0; padding: 10px 8px 10px 10px; text-align: left;
  background: var(--custom-bg, var(--th-bg-2)) !important;
  border: 1px solid var(--custom-border, var(--th-border)) !important;
  border-radius: 14px; color: var(--custom-text, var(--th-text)) !important;
  font: inherit; cursor: pointer; overflow: visible; box-shadow: none;
  transition: transform var(--th-dur) var(--th-ease), border-color var(--th-dur) var(--th-ease), box-shadow var(--th-dur) var(--th-ease), background-color var(--th-dur) var(--th-ease);
  -webkit-tap-highlight-color: transparent;
}
@media (min-width: 400px) { .tp-buy .tp-pkg { grid-template-columns: 44px minmax(0, 1fr); gap: 10px; padding: 10px 10px 10px 12px; } }
@media (hover: hover) {
  .tp-buy .tp-pkg.product-card:hover:not(.selected) { transform: translateY(-2px); border-color: var(--thb-ring) !important; box-shadow: 0 10px 24px -14px var(--thb-ring); }
  .tp-buy .tp-pkg.product-card:hover .tp-pkg-art img:first-child { transform: scale(1.06); }
}
.tp-buy .tp-pkg.product-card:active { transform: scale(.985); }
.tp-buy .tp-pkg.product-card.selected {
  background: linear-gradient(var(--thb-soft), var(--thb-soft)), var(--custom-bg, var(--th-bg-2)) !important;
  border-color: var(--th-pink) !important;
  box-shadow: 0 0 0 1px var(--th-pink), 0 10px 28px -12px var(--thb-ring);
  z-index: 1;
}
.tp-pkg-art { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: radial-gradient(circle at 50% 35%, var(--thb-soft-2), var(--thb-purple-soft) 70%, transparent 100%); }
@media (min-width: 400px) { .tp-pkg-art { width: 44px; height: 44px; } }
.tp-pkg-art img:first-child { width: 100%; height: 100%; object-fit: contain; transition: transform var(--th-dur) var(--th-ease); }
.tp-pkg[data-kind="custom"] .tp-pkg-art { background: var(--th-elev); overflow: hidden; }
.tp-pkg[data-kind="custom"] .tp-pkg-art img:first-child { object-fit: cover; }
.tp-pkg-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tp-buy .tp-pkg-name {
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin: 0; font-size: 13px; font-weight: 600; line-height: 1.4; color: inherit !important; overflow-wrap: anywhere;
}
html[lang="km"] .tp-buy .tp-pkg-name { line-height: 1.55; }
.tp-pkg-qty { font-size: 15px; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.tp-pkg-unit { font-size: 12px; font-weight: 600; color: var(--th-text-2); }
.tp-buy .tp-pkg-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; margin: 0; font-size: 13.5px; font-weight: 800; color: var(--th-pink) !important; font-variant-numeric: tabular-nums; line-height: 1.35; }
.tp-pkg-price .price-strikethrough { font-size: 11.5px; font-weight: 600; color: var(--th-muted); text-decoration: line-through; }
.tp-pkg-badge, .tp-pkg-tag {
  position: absolute; top: -8px; right: 8px; z-index: 2; max-width: calc(100% - 16px);
  padding: 2px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; line-height: 1.6; letter-spacing: .03em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--th-btn-text);
  background: var(--th-btn); background-image: var(--th-grad); box-shadow: 0 4px 10px -4px var(--thb-ring);
}
.tp-badge--hot, .tp-badge--sale { background-image: var(--th-grad-hot); }
.tp-badge--new { background: var(--th-purple); background-image: none; }
.tp-badge--fast { background: var(--th-success); background-image: none; }
.tp-pkg-tag--soon { background: var(--th-elev); background-image: none; color: var(--th-text-2); border: 1px solid var(--th-border-strong); box-shadow: none; }
.tp-pkg-check {
  position: absolute; top: -7px; left: -7px; z-index: 3; width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; color: var(--th-btn-text);
  background: var(--th-btn); background-image: var(--th-grad); box-shadow: 0 0 0 2px var(--th-card);
  opacity: 0; transform: scale(.4); transition: opacity var(--th-dur) var(--th-ease), transform var(--th-dur) var(--th-ease);
}
.tp-pkg.selected .tp-pkg-check { opacity: 1; transform: scale(1); }
.tp-buy .tp-pkg--soon, .tp-buy .tp-pkg--off { cursor: not-allowed; opacity: .62; }
.tp-pkg--soon .tp-pkg-art img, .tp-pkg--off .tp-pkg-art img { filter: grayscale(1); }
.tp-buy .tp-pkg-price--off { color: var(--th-muted) !important; font-weight: 700; font-size: 12.5px; }
.tp-empty { padding: 16px; text-align: center; color: var(--th-muted); font-size: 14px; }

/* ---------- 6. payment methods, coupon, terms ---------- */
.tp-pay-list { display: flex; flex-direction: column; gap: 8px; }
.tp-buy .payment-method-btn.tp-pay {
  position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr) 22px; align-items: center; gap: 12px;
  width: 100%; min-height: 64px; padding: 10px 12px; text-align: left;
  background: var(--th-bg-2) !important; border: 1px solid var(--th-border) !important; border-radius: 14px !important;
  color: var(--th-text) !important; font: inherit; cursor: pointer;
  transition: border-color var(--th-dur) var(--th-ease), box-shadow var(--th-dur) var(--th-ease), background-color var(--th-dur) var(--th-ease);
}
@media (hover: hover) { .tp-buy .payment-method-btn.tp-pay:hover:not(.selected) { border-color: var(--thb-ring) !important; } }
.tp-buy .payment-method-btn.tp-pay.selected { border-color: var(--th-pink) !important; background: linear-gradient(var(--thb-soft), var(--thb-soft)), var(--th-bg-2) !important; box-shadow: 0 0 0 1px var(--th-pink); }
.tp-pay-logo { width: 44px; height: 44px; border-radius: 11px; background: var(--thb-logo-bg); display: grid; place-items: center; overflow: hidden; border: 1px solid var(--th-border); }
.tp-pay-logo img { width: 36px; height: 36px; object-fit: contain; }
.tp-pay-logo span { font-size: 12px; font-weight: 800; color: var(--th-bg); }
.tp-pay-text { display: flex; flex-direction: column; min-width: 0; }
.tp-pay-name { font-size: 15px; font-weight: 700; color: var(--th-text); }
.tp-pay-desc { font-size: 12.5px; color: var(--th-text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tp-buy .payment-method-btn .tick-indicator.tp-pay-radio {
  display: grid !important; place-items: center; position: static; width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--th-border-strong) !important; background: transparent; color: transparent;
}
.tp-buy .payment-method-btn .tp-pay-radio i { font-size: 13px; line-height: 1; color: inherit !important; }
.tp-buy .payment-method-btn.selected .tick-indicator.tp-pay-radio { border-color: transparent !important; background: var(--th-btn); background-image: var(--th-grad); color: var(--th-btn-text); }

.tp-coupon { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--th-border); }
.tp-coupon-row { display: flex; gap: 8px; }
.tp-coupon-row .tp-input { flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: .04em; }
.tp-coupon-row .tp-input::placeholder { text-transform: none; letter-spacing: 0; }
.tp-coupon-row .tp-btn { flex: none; min-height: 48px; }
.tp-terms { display: flex; align-items: flex-start; gap: 10px; margin-top: 14px; font-size: 13.5px; color: var(--th-text-2); }
.tp-terms label { cursor: pointer; }

/* ---------- 7. order summary (desktop) + checkout bar (phones / tablets) ---------- */
#summaryBarDesktop.tp-summary { display: none; }
@media (min-width: 1024px) {
  #summaryBarDesktop.tp-summary { display: flex; flex-direction: column; gap: 12px; padding: 18px; position: sticky; top: calc(var(--th-header-h) + 16px); }
}
.tp-buy .tp-summary-title { font-size: 15px; font-weight: 700; color: var(--th-text); }
.tp-summary-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; background: var(--th-bg-2); border: 1px solid var(--th-border); }
.tp-summary-thumb, .tp-buybar-thumb { flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--thb-soft); overflow: hidden; }
.tp-summary-thumb { width: 44px; height: 44px; }
.tp-summary-thumb img, .tp-buybar-thumb img { width: 100%; height: 100%; object-fit: contain; }
.tp-summary-thumb:has(img.hidden)::before, .tp-buybar-thumb:has(img.hidden)::before { content: ""; width: 18px; height: 18px; border-radius: 6px; border: 2px dashed var(--th-border-strong); }
.tp-summary-itemtext { display: flex; flex-direction: column; min-width: 0; }
.tp-summary-label { font-size: 12px; color: var(--th-muted); }
.tp-summary-name { font-size: 14px; font-weight: 700; color: var(--th-text); overflow-wrap: anywhere; }
.tp-summary-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; color: var(--th-text-2); }
.tp-summary-val { color: var(--th-text); font-weight: 600; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.tp-summary-total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-top: 12px; border-top: 1px dashed var(--th-border-strong); font-size: 14px; font-weight: 600; color: var(--th-text-2); }
.tp-summary-total .tp-money { font-size: 22px; font-weight: 800; color: var(--th-text); }
.tp-summary-note { display: flex; gap: 6px; align-items: flex-start; font-size: 12px; color: var(--th-muted); }
.tp-summary-note svg { flex: none; margin-top: 3px; }

#totalDisplay:empty::before, #totalPriceMobile:empty::before { content: "$0.00 USD"; }
/* the Pay buttons: game-show.js toggles Tailwind classes (opacity-50, bg-gray-400 ...) - ids win */
#buyNowBtn.tp-buy-btn, #buyNowBtnMobile.tp-buy-btn { opacity: 1; background: var(--th-btn) !important; background-image: var(--th-grad) !important; color: var(--th-btn-text) !important; border: 0; font-size: 16px; }
#buyNowBtn.tp-buy-btn { min-height: 52px; border-radius: 14px; }
#buyNowBtn.tp-buy-btn:disabled, #buyNowBtnMobile.tp-buy-btn:disabled { background: var(--th-elev) !important; background-image: none !important; color: var(--th-muted) !important; box-shadow: none !important; transform: none !important; }
.tp-buy-btn .aj-btn-arrow { transition: transform var(--th-dur) var(--th-ease); }
@media (hover: hover) { .tp-buy-btn:not(:disabled):hover .aj-btn-arrow { transform: translateX(3px); } }

#summaryBarMobile.tp-buybar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: var(--th-glass); -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2);
  border-top: 1px solid var(--th-border); box-shadow: 0 -12px 30px -18px var(--th-overlay);
  color: var(--th-text); font-family: var(--th-font);
}
@media (min-width: 1024px) { #summaryBarMobile.tp-buybar { display: none; } }
.tp-buybar-in { display: flex; align-items: center; gap: 10px; max-width: 720px; margin: 0 auto; min-height: 52px; }
.tp-buybar-thumb { width: 40px; height: 40px; }
@media (max-width: 359.98px) { .tp-buybar-thumb { display: none; } }
.tp-buybar-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.tp-buybar-item { font-size: 12.5px; font-weight: 600; color: var(--th-text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-buybar-total { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.tp-buybar-label { font-size: 12px; color: var(--th-muted); }
.tp-buybar-total .tp-money { font-size: 17px; font-weight: 800; color: var(--th-text); }
#buyNowBtnMobile.tp-buy-btn { flex: none; min-height: 48px; padding: 0 18px; border-radius: 14px; }
@media (max-width: 359.98px) { #buyNowBtnMobile.tp-buy-btn { padding: 0 14px; font-size: 15px; } }
/* the fixed bar never covers content: reserve its height at the end of the page */
@media (max-width: 1023.98px) {
  body[data-page="game.show"] { padding-bottom: calc(var(--thb-buybar-h) + env(safe-area-inset-bottom)) !important; }
}

/* ---------- 8. toast, modals ---------- */
#notification.tp-toast {
  position: fixed; top: calc(var(--th-header-h) + 8px); right: 12px; z-index: 9999; width: min(360px, calc(100vw - 24px));
  background: var(--th-card); border: 1px solid var(--th-border-strong); border-radius: 14px; box-shadow: var(--th-shadow);
  color: var(--th-text); font-family: var(--th-font); overflow: hidden;
  transition: transform var(--th-dur-slow) var(--th-ease);
}
#notification.tp-toast.translate-x-full { transform: translateX(calc(100% + 24px)); }
#notification.tp-toast.translate-x-0 { transform: translateX(0); }
.tp-toast-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px 0; }
#notification .notification-badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 7px; font-size: 12px; font-weight: 800; color: var(--th-btn-text); background: var(--th-purple); }
#notification .notification-badge.bg-red-500 { background: var(--th-error); }
#notification .notification-badge.bg-green-600 { background: var(--th-success); }
#notification .notification-badge.bg-yellow-500 { background: var(--th-warning); }
#notification .notification-title { margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .06em; color: var(--th-text-2); }
#notification .message-content { margin: 0; padding: 6px 14px 12px; font-size: 14px; line-height: 1.6; color: var(--th-text); overflow-wrap: anywhere; }

.tp-modal { position: fixed; inset: 0; z-index: 9990; display: flex; align-items: center; justify-content: center; padding: 16px; font-family: var(--th-font); color: var(--th-text); }
.tp-modal-backdrop { position: absolute; inset: 0; background: var(--th-overlay); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; transition: opacity var(--th-dur) var(--th-ease); }
.tp-modal-card { position: relative; width: 100%; max-width: 440px; max-height: calc(100vh - 32px); overflow: auto; padding: 20px; border-radius: 20px; background: var(--th-card); border: 1px solid var(--th-border-strong); box-shadow: var(--th-shadow); opacity: 0; transform: translateY(8px) scale(.98); transition: opacity var(--th-dur) var(--th-ease), transform var(--th-dur) var(--th-ease); display: flex; flex-direction: column; gap: 14px; }
.tp-modal.is-open .tp-modal-backdrop, .tp-modal.is-open .tp-modal-card { opacity: 1; transform: none; }
.tp-modal-title { margin: 0; font-size: 17px; font-weight: 800; color: var(--th-text); line-height: 1.5; }
.tp-modal-headrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tp-modal-body { max-height: 60vh; overflow: auto; }
.tp-share-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.tp-share { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border-radius: 12px; border: 1px solid var(--th-border); background: var(--th-bg-2); color: var(--th-text-2); font: inherit; font-size: 12px; font-weight: 600; text-decoration: none; cursor: pointer; }
.tp-share-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--thb-soft); color: var(--th-pink); font-size: 20px; }
@media (hover: hover) { .tp-share:hover { border-color: var(--thb-ring); color: var(--th-text); } }

/* product pop-up (layout showCustomPopup) and duplicate-order dialog (game-show.js, inline styles use --th-* first) */
#dup-order-dialog [role="alertdialog"] h3 { color: var(--th-text); }
#dup-order-dialog #dup-order-again { background-image: var(--th-grad) !important; box-shadow: var(--th-shadow-pink); }
#dup-order-dialog [aria-hidden="true"] { font-family: var(--th-font); }

/* ---------- 9. unavailable game ---------- */
.tp-gp-off { display: flex; flex-direction: column; gap: 12px; max-width: 760px; margin: 0 auto; }
@media (min-width: 768px) { .tp-gp-off { gap: 16px; } }
.tp-off-note { display: flex; gap: 14px; align-items: flex-start; padding: 18px; border-color: var(--th-border-strong); background: linear-gradient(135deg, var(--thb-purple-soft), transparent 60%), var(--th-card); }
.tp-off-icon { flex: none; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--th-elev); color: var(--th-text-2); border: 1px solid var(--th-border); }
.tp-buy .tp-off-title { font-size: 17px; font-weight: 800; color: var(--th-text); line-height: 1.5; }
.tp-off-text { margin-top: 4px !important; color: var(--th-text-2); font-size: 14px; }
.tp-pkg-grid--off { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
@media (max-width: 359.98px) { .tp-pkg-grid--off { grid-template-columns: minmax(0, 1fr) !important; } }
.tp-off-actions { display: flex; justify-content: center; padding: 4px 0 8px; }

/* ---------- 10. SEO guide block under the game page (partials/seo-game-content) ---------- */
body[data-page="game.show"] .seo-guide { background: transparent !important; padding: 0 0 32px !important; }
body[data-page="game.show"] .seo-guide-in { max-width: 1192px !important; background: var(--th-card) !important; border: 1px solid var(--th-border) !important; border-radius: 16px !important; color: var(--th-text-2) !important; width: calc(100% - 32px) !important; }
@media (min-width: 768px) { body[data-page="game.show"] .seo-guide-in { width: calc(100% - 48px) !important; } }
body[data-page="game.show"] .seo-guide h2, body[data-page="game.show"] .seo-guide h3, body[data-page="game.show"] .seo-faq summary { color: var(--th-text) !important; }
body[data-page="game.show"] .seo-guide a { color: var(--th-pink) !important; }
body[data-page="game.show"] .seo-faq details { border-top-color: var(--th-border) !important; }

/* ---------- 11. KHQR modal (bakong-modal.blade.php) ---------- */
#bakongModal.tp-khqr { position: fixed; inset: 0; z-index: 10040; overflow-y: auto; background: var(--th-overlay); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); font-family: var(--th-font); color: var(--th-text); }
.tp-khqr-center { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
#bakongModalDesktop.tp-khqr-frame {
  position: relative; width: 100%; max-width: 380px; padding: 18px 18px 16px; border-radius: 22px;
  background: var(--th-glass); -webkit-backdrop-filter: blur(18px) saturate(1.2); backdrop-filter: blur(18px) saturate(1.2);
  border: 1.5px solid var(--thb-ring); box-shadow: var(--th-shadow), 0 0 0 6px var(--thb-soft), 0 30px 60px -30px var(--thb-ring);
}
.tp-khqr-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.tp-khqr .tp-khqr-eyebrow { margin: 0; font-size: 11px; font-weight: 800; letter-spacing: .14em; color: var(--th-pink); }
.tp-khqr .tp-khqr-title { margin: 0; font-size: 19px; font-weight: 800; color: var(--th-text); line-height: 1.45; }
.tp-khqr-meta { margin: 12px 0 14px; display: flex; flex-direction: column; gap: 4px; }
.tp-khqr-meta-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.tp-khqr-meta-row[hidden] { display: none; }
.tp-khqr-meta dt { color: var(--th-text-2); }
.tp-khqr-meta dd { margin: 0; color: var(--th-text); font-weight: 600; text-align: right; min-width: 0; }
/* official KHQR card: brand colours on purpose */
.tp-khqr-card { width: 273px; max-width: 100%; margin: 0 auto; background: #fff; color: rgb(8, 27, 55); border-radius: 20px; overflow: hidden; box-shadow: 0 8px 22px -6px rgba(0, 0, 0, .35); font-family: "Battambang", var(--th-font); }
.tp-khqr-card-top { height: 43px; display: flex; align-items: center; justify-content: center; background: rgb(226, 26, 26); }
.tp-khqr-card-notch { width: 0; height: 0; margin-left: auto; border-left: 19.5px solid transparent; border-top: 19.5px solid rgb(226, 26, 26); }
.tp-khqr-card-amount { margin-top: -10px; padding: 0 16px 14px 40px; background-image: linear-gradient(90deg, rgba(128, 128, 128, .85) 65%, transparent 0); background-size: 15px 1.5px; background-position: 50% 100%; background-repeat: repeat-x; }
.tp-khqr-card-merchant { display: block; font-size: 10px; color: #000; line-height: 1.6; }
.tp-khqr-card-sum { display: flex; align-items: baseline; gap: 6px; font-size: 18px; font-weight: 700; color: #000; font-variant-numeric: tabular-nums; }
.tp-khqr-cur { font-size: 9px; font-weight: 400; }
.tp-khqr-card-qr { position: relative; display: flex; align-items: center; justify-content: center; padding: 16px 0 20px; }
.tp-khqr-watermark { position: absolute; max-width: 80%; opacity: .1; pointer-events: none; }
.tp-khqr-qrbox { position: relative; }
.tp-khqr-qrbox > img { display: block; width: 195px; height: 195px; object-fit: contain; margin: 0 auto; }
.tp-khqr-card--m .tp-khqr-qrbox > img { width: min(240px, 66vw); height: min(240px, 66vw); }
.tp-khqr-icon { max-width: 72px; height: auto; }
.tp-khqr-expired { position: absolute; inset: -6px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 12px; text-align: center; border-radius: 12px; background: rgba(255, 255, 255, .96); }
.tp-khqr-expired-ico { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: rgba(226, 26, 26, .1); color: rgb(226, 26, 26); margin-bottom: 4px; }
.tp-khqr-expired-title { margin: 0; font-weight: 700; font-size: 15px; color: rgb(226, 26, 26); }
.tp-khqr-expired-text { margin: 0; font-size: 12.5px; color: rgb(8, 27, 55); }
.tp-khqr-timer { display: flex; align-items: center; justify-content: center; gap: 6px; width: max-content; max-width: 100%; margin: 14px auto 0; padding: 6px 14px; border-radius: 999px; background: var(--th-elev); border: 1px solid var(--th-border); font-size: 12.5px; }
.tp-khqr-timer-label { color: var(--th-text-2); }
.tp-khqr-timer-text { font-weight: 800; font-size: 15px; color: var(--th-success); font-variant-numeric: tabular-nums; }
.tp-spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--th-border-strong); border-top-color: var(--th-pink); animation: tp-spin 1s linear infinite; }
@keyframes tp-spin { to { transform: rotate(360deg); } }
#bakongStatus, #bakongStatusMobile { margin: 10px 0 0; padding: 0 8px; text-align: center; font-size: 14px; font-weight: 600; color: var(--th-text-2) !important; }
#bakongModal[data-state="paid"] #bakongStatus, #bakongModal[data-state="paid"] #bakongStatusMobile, #bakongStatus.text-green-600, #bakongStatusMobile.text-green-600 { color: var(--th-success) !important; }
#bakongModal[data-state="expired"] #bakongStatus, #bakongModal[data-state="expired"] #bakongStatusMobile,
#bakongModal[data-state="failed"] #bakongStatus, #bakongModal[data-state="failed"] #bakongStatusMobile { color: var(--th-error) !important; }
#bakongModal[data-state="expired"] .tp-khqr-timer-text, #bakongModal[data-state="failed"] .tp-khqr-timer-text { color: var(--th-error); }
#bakongModal[data-state="expired"] .tp-spin, #bakongModal[data-state="paid"] .tp-spin, #bakongModal[data-state="failed"] .tp-spin { animation: none; border-color: var(--th-border-strong); }
.tp-khqr-hint { margin: 10px auto 0; max-width: 300px; text-align: center; font-size: 12.5px; color: var(--th-muted); line-height: 1.6; }
#bakongModal .aba-applink { margin: 14px auto 0; max-width: 300px; width: 100%; text-align: center; }
#bakongModal .aba-applink[hidden], #bakongModal .aba-applink-hint[hidden] { display: none !important; }
#bakongModal a.aba-applink-btn[href] { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 48px; padding: 10px 16px; border: 0; border-radius: 14px; background: var(--th-btn); background-image: var(--th-grad); color: var(--th-btn-text); font-size: 15px; font-weight: 700; line-height: 1.3; text-decoration: none; cursor: pointer; box-shadow: var(--th-shadow-pink); -webkit-tap-highlight-color: transparent; touch-action: manipulation; user-select: none; transition: transform var(--th-dur-fast) var(--th-ease); }
#bakongModal a.aba-applink-btn[href]:active { transform: scale(.98); }
#bakongModal a.aba-applink-btn[href]:focus-visible { outline: 3px solid var(--th-pink); outline-offset: 2px; }
#bakongModal a.aba-applink-btn img { flex: none; width: 42px; height: 24px; margin: 0; display: block; border-radius: 5px; box-shadow: 0 0 0 1.5px var(--th-btn-text); pointer-events: none; }
#bakongModal .aba-applink-hint { margin: 8px auto 0; padding: 8px 10px; border-radius: 10px; background: var(--thb-soft); color: var(--th-text); font-size: 12.5px; line-height: 1.55; font-weight: 500; }

/* phone bottom sheet (game-show.js / deposit-show.js set display + translateY inline) */
#bakongModalMobile.tp-khqr-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10001; width: 100%; max-height: 92vh; overflow-y: auto; overscroll-behavior: contain;
  transform: translateY(100%); border-radius: 24px 24px 0 0;
  background: var(--th-card); border-top: 2px solid var(--thb-ring); box-shadow: 0 -20px 50px -20px var(--th-overlay);
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
}
.tp-khqr-sheet-main { position: relative; display: flex; flex-direction: column; padding: 0 16px; }
.tp-khqr-grab { height: 10px; }
.tp-khqr-grab .bakong_checkout_draggable_area { height: 10px; }
#redHeaderDraggable.tp-khqr-sheet-top { position: relative; padding: 14px 52px 4px 4px; cursor: grab; touch-action: none; user-select: none; }
#redHeaderDraggable .bakong_checkout_draggable-thumb { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 44px; height: 4px; border-radius: 4px; background: var(--th-border-strong); pointer-events: none; }
.tp-khqr-sheet-close { position: absolute; top: 18px; right: 16px; z-index: 2; }
.tp-khqr-card--m { width: 100%; max-width: 320px; }
.tp-khqr-card--m .tp-khqr-card-top { height: 56px; }
.tp-khqr-card--m .tp-khqr-card-sum { font-size: 21px; }
.tp-khqr-actions { display: flex; flex-direction: column; gap: 10px; align-items: stretch; max-width: 320px; width: 100%; margin: 12px auto 0; }
.tp-khqr-actions .aba-applink { margin-top: 0 !important; }
.tp-khqr-actions .tp-khqr-hint { margin-top: 0; }
#downloadQRMobile .animate-spin { border-color: currentColor !important; border-top-color: transparent !important; }

/* joyknea modal (inactive method): only the backdrop follows the theme */
#joykneaModal { background: var(--th-overlay) !important; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }

/* ---------- 12. invoice / payment result ---------- */
.tp-receipt-page { padding-top: 24px; padding-bottom: 48px; }
.tp-receipt { position: relative; max-width: 520px; margin: 0 auto; padding: 0 0 20px; overflow: hidden; }
.tp-receipt-head { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 28px 20px 20px; border-bottom: 1px dashed var(--th-border-strong); background: radial-gradient(ellipse at 50% 0%, var(--tp-tone-soft, var(--thb-soft)), transparent 70%); }
.tp-tone--ok { --tp-tone: var(--th-success); --tp-tone-soft: var(--thb-ok-soft); }
.tp-tone--warn { --tp-tone: var(--th-warning); --tp-tone-soft: var(--thb-warn-soft); }
.tp-tone--err { --tp-tone: var(--th-error); --tp-tone-soft: var(--thb-err-soft); }
.tp-tone--muted { --tp-tone: var(--th-text-2); --tp-tone-soft: var(--th-elev); }
.tp-tone--info { --tp-tone: var(--th-purple); --tp-tone-soft: var(--thb-purple-soft); }
.tp-receipt-icon { display: grid; place-items: center; width: 68px; height: 68px; border-radius: 50%; color: var(--tp-tone); background: var(--tp-tone-soft); box-shadow: 0 0 0 8px color-mix(in srgb, var(--tp-tone) 8%, transparent); }
.tp-receipt-icon.is-check .tp-rc-ring { stroke-dasharray: 145; stroke-dashoffset: 145; animation: tp-draw .6s var(--th-ease) .1s forwards; }
.tp-receipt-icon.is-check .tp-rc-tick { stroke-dasharray: 40; stroke-dashoffset: 40; animation: tp-draw .35s var(--th-ease) .6s forwards; }
@keyframes tp-draw { to { stroke-dashoffset: 0; } }
.tp-buy .tp-receipt-title { margin-top: 14px; font-size: 20px; font-weight: 800; color: var(--th-text); line-height: 1.45; }
.tp-receipt-amount { margin-top: 6px !important; font-size: 34px; font-weight: 800; letter-spacing: -.02em; color: var(--th-text); }
.tp-receipt-date { margin-top: 4px !important; font-size: 12.5px; color: var(--th-muted); }
.tp-receipt-text { margin-top: 8px !important; font-size: 14px; color: var(--th-text-2); max-width: 400px; }
.tp-receipt-mascot { position: absolute; right: 8px; bottom: 4px; width: 72px; height: 72px; pointer-events: none; opacity: .95; }
@media (max-width: 419.98px) { .tp-receipt-mascot { width: 56px; height: 56px; right: 4px; } }
.tp-receipt-states { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; padding: 16px 20px 0; }
.tp-state { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 12px; background: var(--th-bg-2); border: 1px solid var(--th-border); min-width: 0; }
.tp-state-k { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--th-muted); }
html[lang="km"] .tp-state-k { text-transform: none; letter-spacing: 0; font-size: 12.5px; }
.tp-state .tp-pill { align-self: flex-start; max-width: 100%; white-space: normal; }
.tp-state-note { grid-column: 1 / -1; font-size: 13px; color: var(--th-text-2); line-height: 1.6; }
.tp-pill--ok { background: var(--thb-ok-soft); color: color-mix(in srgb, var(--th-success) 72%, var(--th-text)); border: 1px solid color-mix(in srgb, var(--th-success) 35%, transparent); }
.tp-pill--warn { background: var(--thb-warn-soft); color: color-mix(in srgb, var(--th-warning) 72%, var(--th-text)); border: 1px solid color-mix(in srgb, var(--th-warning) 35%, transparent); }
.tp-pill--err { background: var(--thb-err-soft); color: color-mix(in srgb, var(--th-error) 72%, var(--th-text)); border: 1px solid color-mix(in srgb, var(--th-error) 35%, transparent); }
.tp-pill--info { background: var(--thb-purple-soft); color: color-mix(in srgb, var(--th-purple) 72%, var(--th-text)); border: 1px solid color-mix(in srgb, var(--th-purple) 35%, transparent); }
.tp-pill--muted { background: var(--th-elev); color: var(--th-text-2); border: 1px solid var(--th-border); }
.tp-dl { margin: 16px 20px 0; padding: 0; display: flex; flex-direction: column; }
.tp-dl > div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--th-border); font-size: 14px; }
.tp-dl > div:last-child { border-bottom: 0; }
.tp-dl dt { color: var(--th-text-2); flex: none; }
.tp-dl dd { margin: 0; color: var(--th-text); font-weight: 600; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.tp-ok-text { color: var(--th-success) !important; }
.tp-notice { margin: 16px 20px 0; padding: 12px 14px; border-radius: 12px; border: 1px dashed var(--th-border-strong); background: var(--th-bg-2); font-size: 13.5px; color: var(--th-text-2); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.tp-notice--ok { border-color: color-mix(in srgb, var(--th-success) 50%, transparent); }
.tp-notice-k { font-size: 12px; color: var(--th-muted); }
.tp-license { font-size: 20px; font-weight: 800; color: var(--th-text); letter-spacing: .08em; }
.tp-notice .tp-spin { display: inline-block; vertical-align: -2px; }
.tp-receipt-actions { display: flex; flex-direction: column; gap: 8px; margin: 20px 20px 0; }
.tp-receipt-actions-row { display: flex; gap: 8px; }
.tp-receipt-actions-row .tp-btn { flex: 1; }
.tp-receipt-thanks { text-align: center; margin-top: 14px !important; font-size: 12.5px; color: var(--th-muted); }
@media (max-width: 359.98px) { .tp-receipt-states { grid-template-columns: minmax(0, 1fr); } }
/* petal confetti (invoice, only when the server says paid) */
.tp-confetti { position: fixed; inset: 0; z-index: 70; pointer-events: none; overflow: hidden; }
.tp-confetti img { position: absolute; top: -30px; height: auto; opacity: 0; animation: tp-fall var(--d, 3s) var(--th-ease) var(--delay, 0s) forwards; }
@keyframes tp-fall { 0% { opacity: 0; transform: translate(0, 0) rotate(0); } 10% { opacity: var(--th-petal-opacity); } 85% { opacity: var(--th-petal-opacity); } 100% { opacity: 0; transform: translate(var(--x, 0), 105vh) rotate(var(--r, 180deg)); } }

/* ---------- 13. order lookup ---------- */
.tp-lookup { max-width: 600px; margin: 8px auto 0; text-align: center; }
.tp-buy .tp-lookup-title { font-size: 26px; font-weight: 800; color: var(--th-text); line-height: 1.4; }
.tp-lookup-sub { margin: 6px 0 18px !important; color: var(--th-text-2); font-size: 14px; }
.tp-lookup-form { padding: 16px; text-align: left; }
.tp-lookup-row { display: flex; flex-direction: column; gap: 8px; }
@media (min-width: 560px) { .tp-lookup-row { flex-direction: row; } }
.tp-lookup-input { position: relative; flex: 1; min-width: 0; }
.tp-lookup-input .tp-input { padding-right: 48px; }
.tp-lookup-paste { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent; color: var(--th-text-2); cursor: pointer; }
@media (hover: hover) { .tp-lookup-paste:hover { color: var(--th-pink); background: var(--thb-soft); } }
.tp-lookup-row .tp-btn { min-height: 48px; }
.tp-lookup-hint { margin-top: 12px !important; font-size: 13.5px; color: var(--th-text-2); }
.tp-recent { max-width: 760px; margin: 36px auto 0; }
.tp-buy .tp-recent-title { font-size: 18px; font-weight: 800; color: var(--th-text); }
.tp-recent-sub { margin: 2px 0 12px !important; font-size: 13px; color: var(--th-muted); }
.tp-recent-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tp-recent-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; box-shadow: none; }
.tp-recent-main { display: flex; flex-direction: column; min-width: 0; }
.tp-recent-item { font-size: 14px; font-weight: 700; color: var(--th-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-recent-meta { font-size: 12px; color: var(--th-muted); overflow-wrap: anywhere; }
.tp-recent-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.tp-recent-price { font-weight: 800; color: var(--th-text); font-size: 14px; }
.tp-empty-card { padding: 24px; text-align: center; color: var(--th-text-2); font-size: 14px; box-shadow: none; }
.tp-empty-title { font-weight: 700; color: var(--th-text); }

/* ---------- 14. reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .tp-buy *, .tp-buybar *, .tp-khqr *, .tp-modal *, #notification.tp-toast { transition: none !important; animation: none !important; }
  .tp-buy .tp-pkg.product-card:hover:not(.selected) { transform: none; }
  .tp-receipt-icon.is-check .tp-rc-ring, .tp-receipt-icon.is-check .tp-rc-tick { stroke-dashoffset: 0; }
  .tp-confetti { display: none; }
}
