/*
 * Widget de promoção de raro (/ds/promo-widget.js): popup no canto, banner (catálogo do jogo) e janela de compra.
 * Independente do resto: funciona na CMS (ds.css) e dentro do jogo (theme-client.css), com cores próprias.
 */
.hbp, .hbp * { box-sizing: border-box; }
.hbp { --hbp-navy: #0b1840; --hbp-blue: #1f4fd8; --hbp-lime: #b6ff3b; --hbp-pink: #ff4fa3; --hbp-silver: #f1f0ec;
    --hbp-title: linear-gradient(90deg, #0b2a8a 0%, #1f4fd8 55%, #5aa8ff 100%);
    --hbp-display: "Pixelify Sans", "Inter", sans-serif; --hbp-ui: "Inter", Ubuntu, "Segoe UI", sans-serif; --hbp-mono: "VT323", ui-monospace, monospace;
    font: 500 13px/1.35 var(--hbp-ui); color: #fff; }

/* ---------- Partes comuns ---------- */
.hbp-sprite { display: block; image-rendering: pixelated; background-repeat: no-repeat; filter: drop-shadow(0 3px 0 #0b184080);
    animation: hbp-anim var(--hbp-dur, .4s) steps(var(--hbp-frames, 1)) infinite; }
.hbp-sprite.is-static { animation: none; }
@keyframes hbp-anim { from { background-position: 0 0; } to { background-position: var(--hbp-end) 0; } }
.hbp-tag { display: inline-flex; align-items: center; gap: .3em; padding: .15em .45em; font: 700 10px/1.2 var(--hbp-ui); letter-spacing: .08em; text-transform: uppercase; color: #fff;
    background: linear-gradient(180deg, #ff8cc6, #ff4fa3 55%, #e23d8c); box-shadow: 0 0 0 1px var(--hbp-navy), 2px 2px 0 var(--hbp-navy); animation: hbp-blink 900ms steps(2, end) infinite; }
@keyframes hbp-blink { 50% { background: var(--hbp-lime); color: var(--hbp-navy); } }
.hbp-title { margin: .35em 0 .1em; font: 700 19px/1.05 var(--hbp-display); color: #fff; text-shadow: 2px 2px 0 var(--hbp-navy); }
.hbp-blocks { display: flex; gap: 2px; margin-top: 3px; }
.hbp-blocks i { flex: 1; height: 8px; background: #ffffff26; box-shadow: inset 0 0 0 1px #ffffff40; }
.hbp-blocks i.is-on { background: linear-gradient(180deg, #e4ff9e, #b6ff3b 55%, #8fd61f); box-shadow: 0 0 0 1px var(--hbp-navy); }
.hbp-blocks i.is-last { animation: hbp-blink 700ms steps(2, end) infinite; }
.hbp-stock { font: 700 12px var(--hbp-ui); }
.hbp-lcd { display: inline-flex; align-items: center; gap: .3em; padding: .05em .35em; background: var(--hbp-navy); color: var(--hbp-lime); border-radius: 2px;
    font: 400 14px/1 var(--hbp-mono); letter-spacing: .06em; box-shadow: 0 0 0 1px #000, inset 0 0 6px #b6ff3b33; text-shadow: 0 0 4px #b6ff3b80; }
.hbp-lcd small { font: 700 7px/1.05 var(--hbp-ui); letter-spacing: .04em; color: #ffffffb3; text-shadow: none; text-transform: uppercase; }
.hbp-price { display: flex; align-items: center; gap: .35em; font: 700 22px/1 var(--hbp-display); color: var(--hbp-navy); }
.hbp-price img { width: 21px; height: 21px; image-rendering: pixelated; }
.hbp-price small { font: 600 10px var(--hbp-ui); color: #5d6578; }
.hbp-btn { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: .4em; padding: .55em .9em; border-radius: 3px; position: relative; overflow: hidden;
    font: 800 12px/1 var(--hbp-ui); letter-spacing: .04em; text-transform: uppercase; color: #fff; text-shadow: 1px 1px 0 #7a1a46;
    background: linear-gradient(180deg, #ff9fd0 0%, #ff4fa3 50%, #e23d8c 52%, #c92f78 100%); box-shadow: 0 0 0 1px var(--hbp-navy), inset 1px 1px 0 #ffffff99, inset -1px -2px 0 #a3255f, 2px 2px 0 #0b184033; }
.hbp-btn::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 40%; background: linear-gradient(90deg, transparent, #ffffff80, transparent); transform: translateX(-120%) skewX(-20deg); }
.hbp-btn:hover::after { animation: hbp-sheen 520ms ease-out; }
@keyframes hbp-sheen { to { transform: translateX(260%) skewX(-20deg); } }
.hbp-btn:active { transform: translate(1px, 1px); }
.hbp-btn:focus-visible { outline: 1px dotted #fff; outline-offset: -4px; }
.hbp-btn[disabled] { cursor: default; filter: grayscale(.6); opacity: .75; }
.hbp-btn.is-ghost { color: var(--hbp-navy); text-shadow: none; background: var(--hbp-silver); box-shadow: 0 0 0 1px var(--hbp-navy), inset 1px 1px 0 #fff, inset -1px -1px 0 #7b7f8c; }
.hbp-btn.is-busy { color: transparent; text-shadow: none; pointer-events: none; }
.hbp-btn.is-busy::before { content: ""; position: absolute; inset: 0; margin: auto; width: 26px; height: 6px; background: repeating-linear-gradient(90deg, #fff 0 6px, transparent 6px 10px); animation: hbp-blink 500ms steps(2) infinite; }
.hbp-note { font-size: 10px; color: #5d6578; text-align: center; }
.hbp-note.is-ok { color: #157a1d; font-weight: 800; }
.hbp-stamp { position: absolute; z-index: 3; padding: .2em .6em; border: 2px solid var(--hbp-pink); border-radius: 3px; transform: rotate(-12deg);
    font: 700 16px var(--hbp-display); letter-spacing: .08em; color: var(--hbp-pink); background: #0b1840cc; }
.hbp-x { all: unset; cursor: pointer; width: 16px; height: 14px; display: grid; place-items: center; border-radius: 1px; color: var(--hbp-navy); font: 700 11px/1 var(--hbp-ui);
    background: var(--hbp-silver); box-shadow: 0 0 0 1px var(--hbp-navy), inset 1px 1px 0 #fff, inset -1px -1px 0 #7b7f8c; }
.hbp-x:active { box-shadow: 0 0 0 1px var(--hbp-navy), inset 1px 1px 0 #7b7f8c, inset -1px -1px 0 #fff; }
.hbp-x:focus-visible { outline: 1px dotted #fff; outline-offset: 2px; }

/* ---------- Popup no canto ---------- */
.hbp-popup { position: fixed; right: 14px; bottom: calc(var(--hbp-bottom, 14px)); z-index: 9000; width: 228px; padding-top: 48px; pointer-events: none;
    animation: hbp-in 420ms cubic-bezier(.34, 1.56, .64, 1) both; }
.hbp-popup > * { pointer-events: auto; }
@keyframes hbp-in { from { opacity: 0; transform: translateY(30px) scale(.92); } to { opacity: 1; transform: none; } }
.hbp-popup.is-leaving { animation: hbp-out 200ms ease-in forwards; }
@keyframes hbp-out { to { opacity: 0; transform: translateY(20px) scale(.95); } }
.hbp-win { position: relative; border-radius: 4px; background: var(--hbp-silver); padding: 3px; box-shadow: 0 0 0 1px var(--hbp-navy), inset 1px 1px 0 #fff, inset -1px -1px 0 #7b7f8c, 5px 5px 0 #0b184055; }
.hbp-bar { display: flex; align-items: center; gap: .4em; height: 22px; padding: 0 4px 0 7px; border-radius: 2px; background: var(--hbp-title); font: 800 11px var(--hbp-ui); color: #fff; text-shadow: 1px 1px 0 #0b184080; }
.hbp-bar span { flex: 1; }
.hbp-min { position: absolute; top: 7px; right: 7px; z-index: 4; }
.hbp-hero { position: relative; height: 74px; border-radius: 2px; overflow: visible;
    background: url(/habblit/promo-bg.png) center / cover no-repeat, radial-gradient(ellipse at 50% 100%, #b6ff3b55 0%, transparent 55%), linear-gradient(180deg, #0b1840 0%, #1c2b8a 70%, #3d7be0 100%);
    box-shadow: inset 0 0 0 1px #0b1840; image-rendering: pixelated; }
.hbp-popup .hbp-sprite { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); }
.hbp-popup .hbp-stamp { left: 50%; top: 40%; transform: translate(-50%, -50%) rotate(-12deg); }
.hbp-body { padding: 6px 7px 5px; color: var(--hbp-navy); }
.hbp-body .hbp-title { color: var(--hbp-navy); text-shadow: none; font-size: 15px; }
.hbp-body .hbp-blocks i { background: #e4e2db; box-shadow: inset 0 0 0 1px #9aa3b5; }
.hbp-body .hbp-blocks i.is-on { background: linear-gradient(180deg, #e4ff9e, #b6ff3b 55%, #8fd61f); box-shadow: 0 0 0 1px var(--hbp-navy); }
.hbp-row { display: flex; align-items: center; justify-content: space-between; gap: .5em; margin-top: 5px; }
.hbp-popup .hbp-btn { width: 100%; margin-top: 6px; padding: .5em .8em; font-size: 11px; }
.hbp-popup .hbp-note { margin-top: 4px; }
/* Aba para reabrir quando minimizado */
.hbp-tab { all: unset; cursor: pointer; }
.hbp-tab { position: fixed; right: 14px; bottom: var(--hbp-bottom, 14px); z-index: 9000; display: flex; align-items: center; gap: .4em; padding: .35em .7em .35em .35em; border-radius: 3px;
    font: 800 11px var(--hbp-ui); text-transform: uppercase; letter-spacing: .05em; color: #fff; text-shadow: 1px 1px 0 #7a1a46;
    background: linear-gradient(180deg, #ff9fd0, #ff4fa3 55%, #e23d8c); box-shadow: 0 0 0 1px var(--hbp-navy), inset 1px 1px 0 #ffffff99, 3px 3px 0 #0b184055; animation: hbp-in 300ms cubic-bezier(.34, 1.56, .64, 1) both; }
.hbp-tab .hbp-sprite { animation-duration: calc(var(--hbp-dur) * 1.4); }

/* ---------- Banner (início do catálogo) ---------- */
.hbp-banner { position: relative; display: grid; grid-template-columns: 104px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 92px; margin: 0 0 8px; padding: 8px 10px 8px 0; border-radius: 4px; overflow: visible;
    background: url(/habblit/promo-bg.png) center / cover no-repeat, radial-gradient(ellipse at 12% 90%, #b6ff3b44 0%, transparent 40%), linear-gradient(90deg, #0b1840 0%, #1c2b8a 60%, #3d7be0 100%);
    box-shadow: 0 0 0 1px var(--hbp-navy), inset 1px 1px 0 #ffffff40, 3px 3px 0 #0b184040; image-rendering: pixelated; }
.hbp-banner .hbp-sprite { justify-self: center; align-self: center; }
.hbp-banner-info { min-width: 0; }
.hbp-banner .hbp-title { font-size: 17px; }
.hbp-banner-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.hbp-banner-meta .hbp-blocks { width: 110px; }
.hbp-banner-buy { display: flex; flex-direction: column; align-items: stretch; gap: 5px; padding: 6px; border-radius: 3px; background: var(--hbp-silver);
    box-shadow: 0 0 0 1px var(--hbp-navy), inset 1px 1px 0 #fff, inset -1px -1px 0 #7b7f8c; }
.hbp-banner .hbp-stamp { left: 60px; top: 50%; transform: translate(-50%, -50%) rotate(-12deg); }

/* ---------- Janela de confirmação ---------- */
.hbp-modal { position: fixed; inset: 0; z-index: 10001; display: grid; place-items: center; padding: 16px; background: #0b184066; background-image: radial-gradient(#0b184033 1px, transparent 1px); background-size: 3px 3px; }
.hbp-modal .hbp-win { width: min(340px, 100%); animation: hbp-in 260ms cubic-bezier(.34, 1.56, .64, 1) both; }
.hbp-modal-body { display: flex; gap: 10px; align-items: center; padding: 10px; color: var(--hbp-navy); }
.hbp-modal-actions { display: flex; gap: 6px; padding: 0 10px 10px; }
.hbp-modal-actions .hbp-btn { flex: 1; }
.hbp-shake { animation: hbp-shake 380ms cubic-bezier(.36, .07, .19, .97); }
@keyframes hbp-shake { 20%, 80% { transform: translateX(3px); } 40%, 60% { transform: translateX(-5px); } }

@media (max-width: 520px) {
    .hbp-popup { right: 8px; left: 8px; width: auto; }
    .hbp-banner { grid-template-columns: 90px minmax(0, 1fr); }
    .hbp-banner-buy { grid-column: 1 / -1; margin-left: 10px; }
}
@media (prefers-reduced-motion: reduce) { html:not(.hb-motion-on) .hbp-sprite, html:not(.hb-motion-on) .hbp-tag, html:not(.hb-motion-on) .hbp-blocks i.is-last, html:not(.hb-motion-on) .hbp-popup, html:not(.hb-motion-on) .hbp-tab, html:not(.hb-motion-on) .hbp-modal .hbp-win { animation: none !important; } }
/* Popup um pouco mais compacto */
.hbp-popup .hbp-price { font-size: 18px; }
.hbp-popup .hbp-price img { width: 17px; height: 17px; }
.hbp-popup .hbp-blocks i { height: 6px; }
.hbp-popup .hbp-stock { font-size: 11px; }
