:root {
  --pm-accent: #f59e0b;
  --pm-accent-dark: #b45309;
  --pm-bg: #f6f4ef;
  --pm-ink: #1f2430;
  --pm-frame: 430px;
  --pm-nav-h: 64px;
}
html, body { height: 100%; }
body { background: #e9e6df; color: var(--pm-ink); font-size: 15px; -webkit-font-smoothing: antialiased; }
.app { max-width: var(--pm-frame); margin: 0 auto; min-height: 100vh; background: var(--pm-bg); position: relative; padding-bottom: calc(var(--pm-nav-h) + 16px); box-shadow: 0 0 0 1px rgba(0,0,0,.05); }
@media (min-width: 500px) { body { padding: 16px 0; } .app { min-height: calc(100vh - 32px); border-radius: 24px; overflow: hidden; } }
.app-header { position: sticky; top: 0; z-index: 1020; background: var(--pm-bg); padding: 14px 16px 10px; display: flex; align-items: center; gap: 10px; }
.app-header .title { font-weight: 700; font-size: 1.1rem; flex: 1; }
.app-header .icon-btn { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #fff; border: 1px solid #e5e7eb; color: var(--pm-ink); text-decoration: none; }
.app-body { padding: 0 16px; }
.bottom-nav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: var(--pm-frame); height: var(--pm-nav-h); background: #fff; border-top: 1px solid #e5e7eb; display: flex; z-index: 1030; padding-bottom: env(safe-area-inset-bottom); }
@media (min-width: 500px) { .bottom-nav { bottom: 16px; border-radius: 0 0 24px 24px; } }
.bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: .7rem; color: #6b7280; text-decoration: none; }
.bottom-nav a i { font-size: 1.3rem; }
.bottom-nav a.active { color: var(--pm-accent-dark); font-weight: 600; }
.bottom-nav a.draw-cta { position: relative; }
.bottom-nav a.draw-cta span.blob { position: absolute; top: -18px; width: 52px; height: 52px; border-radius: 50%; background: var(--pm-accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; box-shadow: 0 6px 14px rgba(245,158,11,.4); }
.bottom-nav a.draw-cta > i { opacity: 0; }
.card { border: 1px solid #ebe7de; border-radius: 16px; box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.btn-mamak { background: var(--pm-accent); border-color: var(--pm-accent); color: #fff; font-weight: 600; }
.btn-mamak:hover, .btn-mamak:focus { background: var(--pm-accent-dark); border-color: var(--pm-accent-dark); color: #fff; }
.btn-outline-mamak { border-color: var(--pm-accent); color: var(--pm-accent-dark); font-weight: 600; }
.wallet-strip { background: linear-gradient(135deg, #1f2430, #3b4252); color: #fff; border-radius: 16px; padding: 14px 16px; }
.wallet-strip .lbl { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; opacity: .7; }
.wallet-strip .val { font-size: 1.25rem; font-weight: 700; }
.luck-pill { background: #fef3c7; color: #92400e; border-radius: 999px; padding: 4px 10px; font-size: .75rem; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.pills { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; flex-wrap: nowrap; }
.pills::-webkit-scrollbar { display: none; }
.pills .nav-link { white-space: nowrap; border-radius: 999px; padding: 6px 14px; font-size: .85rem; background: #fff; border: 1px solid #e5e7eb; color: var(--pm-ink); }
.pills .nav-link.active { background: var(--pm-ink); color: #fff; border-color: var(--pm-ink); }
.pack-card { overflow: hidden; }
.pack-cover { height: 110px; background: linear-gradient(135deg, #fde68a, #f59e0b); position: relative; display: flex; align-items: flex-end; padding: 10px 12px; color: #1f2430; }
.pack-cover.c2 { background: linear-gradient(135deg, #a7f3d0, #10b981); }
.pack-cover.c3 { background: linear-gradient(135deg, #bfdbfe, #3b82f6); }
.pack-cover.c4 { background: linear-gradient(135deg, #fecaca, #ef4444); }
.pack-cover.c5 { background: linear-gradient(135deg, #ddd6fe, #8b5cf6); }
.pack-cover .price { position: absolute; top: 10px; right: 10px; background: #fff; border-radius: 999px; padding: 3px 10px; font-weight: 700; font-size: .85rem; }
.pack-cover .pts { position: absolute; top: 10px; left: 10px; background: rgba(31,36,48,.85); color: #fff; border-radius: 999px; padding: 3px 8px; font-size: .7rem; }
.pack-cover .name { font-weight: 700; font-size: 1.05rem; }
.progress { height: 6px; }
.tier-badge { display: inline-block; min-width: 26px; text-align: center; border-radius: 6px; padding: 2px 6px; font-weight: 700; font-size: .75rem; color: #fff; }
.tier-S { background: #dc2626; } .tier-A { background: #f59e0b; } .tier-B { background: #3b82f6; } .tier-C { background: #6b7280; }
.feed { background: #fff; border-radius: 12px; padding: 8px 12px; font-size: .8rem; overflow: hidden; height: 36px; position: relative; }
.feed div { position: absolute; left: 12px; right: 12px; top: 8px; transition: opacity .4s; opacity: 0; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.feed div.show { opacity: 1; }
.action-bar { position: fixed; bottom: var(--pm-nav-h); left: 50%; transform: translateX(-50%); width: 100%; max-width: var(--pm-frame); background: #fff; border-top: 1px solid #e5e7eb; padding: 10px 16px; z-index: 1025; }
@media (min-width: 500px) { .action-bar { bottom: calc(var(--pm-nav-h) + 16px); } }
.has-action-bar { padding-bottom: calc(var(--pm-nav-h) + 130px); }
.modal-sheet .modal-dialog { position: fixed; bottom: 0; left: 50%; transform: translate(-50%, 0) !important; margin: 0; width: 100%; max-width: var(--pm-frame); }
.modal-sheet .modal-content { border-radius: 20px 20px 0 0; border: 0; max-height: 90vh; }
.modal-sheet .modal-body { overflow-y: auto; }
.modal-sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: #d1d5db; margin: 10px auto 0; }
.modal-full .modal-dialog { max-width: var(--pm-frame); margin: 0 auto; }
.modal-full .modal-content { min-height: 100vh; border: 0; border-radius: 0; background: #14161c; color: #fff; }
.reveal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.reveal-grid.single { grid-template-columns: 1fr; max-width: 220px; margin: 0 auto; }
.flip { aspect-ratio: 5 / 7; cursor: pointer; }
.flip .inner { position: relative; width: 100%; height: 100%; }
.flip.flipped .inner { animation: flipcard .6s ease-in-out; }
@keyframes flipcard { 0% { transform: scaleX(1); } 50% { transform: scaleX(0); } 100% { transform: scaleX(1); } }
.flip .face { position: absolute; inset: 0; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 8px; font-size: .75rem; }
.flip .front { background: linear-gradient(135deg, #3b4252, #1f2430); border: 2px solid #f59e0b; color: #f59e0b; font-weight: 700; font-size: 1.4rem; opacity: 1; }
.flip .back { background: #fff; color: #1f2430; border: 3px solid #6b7280; opacity: 0; }
.flip.flipped .front { opacity: 0; transition: opacity 0s .3s; }
.flip.flipped .back { opacity: 1; transition: opacity 0s .3s; }
.flip .back.tier-S { border-color: #dc2626; box-shadow: 0 0 24px rgba(220,38,38,.8); }
.flip .back.tier-A { border-color: #f59e0b; box-shadow: 0 0 18px rgba(245,158,11,.7); }
.flip .back.tier-B { border-color: #3b82f6; }
.flip .back .nm { font-weight: 600; line-height: 1.15; }
.flip .back .vl { font-size: .7rem; color: #6b7280; }
.item-card .thumb { height: 120px; border-radius: 12px 12px 0 0; background: #e5e7eb; display: flex; align-items: center; justify-content: center; color: #9ca3af; font-size: 2rem; position: relative; }
.item-card .thumb .tier-badge { position: absolute; top: 8px; left: 8px; }
.item-card .thumb .chk { position: absolute; top: 8px; right: 8px; }
.mission { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f0ede6; }
.mission:last-child { border-bottom: 0; }
.mission .ic { width: 40px; height: 40px; border-radius: 12px; background: #fef3c7; color: #b45309; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }
.podium { display: flex; align-items: flex-end; gap: 8px; justify-content: center; }
.podium .p { flex: 1; text-align: center; background: #fff; border-radius: 14px; padding: 12px 6px; border: 2px solid #e5e7eb; }
.podium .p.first { border-color: #f59e0b; transform: translateY(-10px); background: #fffbeb; }
.podium .p.second { border-color: #9ca3af; } .podium .p.third { border-color: #b45309; }
.podium .medal { font-size: 1.6rem; }
.list-group-item { border-color: #f0ede6; }
.ledger-amt.pos { color: #16a34a; font-weight: 600; } .ledger-amt.neg { color: #dc2626; font-weight: 600; }
.tier-chip { border-radius: 999px; padding: 2px 10px; font-size: .75rem; font-weight: 700; color: #fff; }
.tier-Bronze { background: #a16207; } .tier-Silver { background: #6b7280; } .tier-Gold { background: #d97706; } .tier-Diamond { background: #0ea5e9; } .tier-Ruby { background: #dc2626; } .tier-Platinum { background: #1f2430; }
.qr { width: 160px; height: 160px; margin: 0 auto; background-image: repeating-linear-gradient(90deg, #1f2430 0 8px, transparent 8px 16px), repeating-linear-gradient(0deg, #1f2430 0 8px, #fff 8px 16px); border: 8px solid #fff; border-radius: 8px; box-shadow: 0 0 0 1px #e5e7eb; }
.amount-chips .btn { border-radius: 999px; }
.section-title { font-weight: 700; font-size: .95rem; margin: 18px 0 8px; display: flex; align-items: center; }
.section-title a { margin-left: auto; font-size: .8rem; font-weight: 500; }
.small-muted { font-size: .78rem; color: #6b7280; }
