/* Bula premiada (farmácias e drogarias).
 *
 * Cores de MARCA como var(--jg-<hex>, #<hex>); papel, madeira, latão, dourado e o
 * vermelho do carimbo em hex direto. Nunca azul.
 *
 * Contrato:
 *  - Estado FINAL por classe estática ou @keyframes … forwards.
 *  - Movimento reduzido: cada coisa para num estado VISÍVEL.
 *  - O papel corre por JS (translateY + borrão pela velocidade). A seção parada
 *    fica sempre centrada na janela, que é onde a lente e a faixa estão.
 *  - O carimbo nasce vazio e SEM classe de cor: verde/vermelho só no desfecho.
 */

.bu__palco {
    position: relative;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    aspect-ratio: 16 / 11;
    border-radius: 14px;
    overflow: hidden;
    background:
        repeating-linear-gradient(92deg, rgba(255, 255, 255, .035) 0 2px, rgba(0, 0, 0, 0) 2px 9px),
        linear-gradient(180deg, #6A4629, #4A301C);
    box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .55);
    user-select: none;
    font-family: Arial, sans-serif;
}

.bu__rotulo {
    position: absolute;
    left: 50%; top: 2.5%;
    transform: translateX(-50%);
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--jg-14532d, #14532d);
    border: 1px solid #C9A227;
    font: 700 10px/1 Arial, sans-serif;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #FFF3C4;
    white-space: nowrap;
    z-index: 8;
}
.bu__rotulo img { width: 12px; height: 12px; }

/* ---------------- o rolo de papel ---------------- */

.bu__janela {
    position: absolute;
    left: 18%; width: 64%;
    top: 14%; height: 72%;
    overflow: hidden;
    background: #F4E7C5;
    box-shadow: inset 0 0 18px rgba(120, 80, 20, .35), 0 6px 14px -6px rgba(0, 0, 0, .6);
    z-index: 2;
}
.bu__fita { will-change: transform; }

.bu__secao {
    height: 100px;
    box-sizing: border-box;
    padding: 12px 16px 0;
    border-bottom: 1px dashed #D5C194;
}
.bu__titulo { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.bu__titulo span {
    width: 18px; height: 18px; flex: none;
    border-radius: 50%;
    background: #7A5A2B; color: #F4E7C5;
    font: 700 10px/18px Georgia, serif; text-align: center;
}
.bu__titulo i { display: block; height: 8px; width: 46%; border-radius: 3px; background: #8B6B3D; opacity: .85; }
.bu__linha { display: block; height: 5px; margin: 0 0 8px; border-radius: 3px; background: #B9A77F; opacity: .75; }

/* marca-texto da seção sob a lente (igual nas duas jogadas) */
.bu__faixa {
    position: absolute;
    left: 0; right: 0; top: 50%;
    height: 100px;
    transform: translateY(-50%);
    background: rgba(255, 226, 110, .42);
    box-shadow: inset 0 0 0 1.5px rgba(201, 162, 39, .6);
    opacity: 0;
    pointer-events: none;
}
.bu--lente .bu__faixa { animation: bu-acende .35s ease-out forwards; }
@keyframes bu-acende { to { opacity: 1; } }

/* rolos de madeira: o veio anda com o papel (JS mexe no background-position) */
.bu__rolo {
    position: absolute;
    left: 13%; width: 74%;
    height: 7%;
    border-radius: 99px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .35), rgba(255, 255, 255, 0) 45%, rgba(0, 0, 0, .25)),
        repeating-linear-gradient(180deg, #8B5E34 0 3px, #A8743F 3px 7px);
    box-shadow: 0 4px 8px -3px rgba(0, 0, 0, .6);
    z-index: 3;
}
.bu__rolo::before, .bu__rolo::after {
    content: '';
    position: absolute; top: -15%;
    width: 5%; height: 130%;
    border-radius: 40%;
    background: linear-gradient(180deg, #F3D77A, #C9A227 55%, #8A6D1F);
}
.bu__rolo::before { left: -3%; }
.bu__rolo::after  { right: -3%; }
.bu__rolo--cima  { top: 10.5%; }
.bu__rolo--baixo { top: 82.5%; }

/* ---------------- lente de aumento ---------------- */

.bu__lente {
    position: absolute;
    left: 50%; top: 50%;
    width: 40%;
    aspect-ratio: 1;
    border-radius: 50%;
    box-sizing: border-box;
    border: 9px solid #C9A227;
    background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .45), rgba(255, 250, 225, .08) 55%, rgba(255, 240, 200, .18));
    box-shadow: inset 0 0 0 2px #8A6D1F, inset 0 0 14px rgba(0, 0, 0, .25), 0 10px 18px -6px rgba(0, 0, 0, .55), 0 0 0 2px #F3D77A;
    transform: translate(10%, 30%) scale(.6) rotate(-12deg);
    opacity: 0;
    z-index: 5;
    pointer-events: none;
}
/* cabo */
.bu__lente i {
    position: absolute;
    left: 86%; top: 86%;
    width: 16%; height: 48%;
    border-radius: 8px;
    background: linear-gradient(90deg, #5A3A1E, #8B5E34 50%, #5A3A1E);
    transform: rotate(-45deg);
    transform-origin: 50% 0;
    box-shadow: 0 4px 8px -3px rgba(0, 0, 0, .6);
}
.bu__lente i::before {
    content: ''; position: absolute; left: -12%; top: -12%; width: 124%; height: 22%;
    border-radius: 4px; background: #C9A227;
}
.bu--lente .bu__lente { animation: bu-lente .5s cubic-bezier(.3, 1.2, .5, 1) forwards; }
@keyframes bu-lente {
    to { transform: translate(-50%, -50%) scale(1) rotate(0deg); opacity: 1; }
}

/* ---------------- carimbo ---------------- */

.bu__carimbo {
    position: absolute;
    left: 50%; top: 50%;
    width: 46%;
    box-sizing: border-box;
    padding: 8px 6px;
    border-radius: 10px;
    border: 5px solid currentColor;
    box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .7), inset 0 0 0 5px currentColor;
    text-align: center;
    font: 900 clamp(15px, 4.4vw, 25px)/1.05 'Arial Black', Arial, sans-serif;
    letter-spacing: .04em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, .55);
    transform: translate(-50%, -50%) rotate(-14deg) scale(2.6);
    opacity: 0;
    z-index: 6;
    pointer-events: none;
}
.bu__carimbo span { display: block; }
.bu__carimbo--sim { color: var(--jg-0a7a00, #0A7A00); }
.bu__carimbo--nao { color: #C0392B; }
.bu--carimbo .bu__carimbo { animation: bu-carimbo .38s cubic-bezier(.5, 0, .7, 1) forwards; }
@keyframes bu-carimbo {
    0%   { transform: translate(-50%, -50%) rotate(-14deg) scale(2.6); opacity: 0; }
    70%  { transform: translate(-50%, -50%) rotate(-14deg) scale(.94); opacity: .95; }
    100% { transform: translate(-50%, -50%) rotate(-14deg) scale(1); opacity: .93; }
}
/* o tranco do carimbo na mesa */
.bu--carimbo .bu__janela { animation: bu-tranco .3s .25s ease-out; }
@keyframes bu-tranco { 30% { transform: translateY(2px); } }

/* ---------------- placa do prêmio ---------------- */

.bu__placa {
    position: absolute;
    left: 50%; bottom: 3%;
    width: 60%;
    transform: translate(-50%, 16px);
    opacity: 0;
    display: flex; align-items: center; gap: 8px;
    padding: 6px 9px;
    box-sizing: border-box;
    border-radius: 8px;
    background: linear-gradient(180deg, #FFF8DC, #F5E3A1);
    border: 1.5px solid #C9A227;
    box-shadow: 0 8px 16px -8px rgba(0, 0, 0, .7);
    z-index: 9;
}
.bu__placa img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; flex: none; }
.bu__placa div { font: 700 clamp(11px, 2.8vw, 13px)/1.25 Arial, sans-serif; color: var(--jg-14532d, #14532d); min-width: 0; }
.bu__placa small { display: block; font: 700 9px/1.2 Arial, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: #8A6D1F; margin-bottom: 2px; }
.bu--placa .bu__placa { animation: bu-placa .5s cubic-bezier(.3, 1.3, .5, 1) forwards; }
@keyframes bu-placa { to { transform: translate(-50%, 0); opacity: 1; } }

/* ---------------- botão e mensagem ---------------- */

.bu__botao {
    display: block;
    width: 100%;
    max-width: 480px;
    margin: 10px auto 0;
    padding: 12px 10px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(180deg, var(--jg-2aa152, #2AA152), var(--jg-0a7a00, #0A7A00));
    color: #fff;
    font: 700 15px/1.2 Arial, sans-serif;
    letter-spacing: .02em;
    cursor: pointer;
    touch-action: manipulation;
    box-shadow: 0 6px 14px -6px rgba(var(--jg-rgb-0a7a00, 10,122,0), .8), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.bu__botao:hover:not(:disabled) { filter: brightness(1.06); }
.bu__botao:disabled { opacity: .55; cursor: default; }

.bu__msg {
    max-width: 480px;
    min-height: 56px;
    margin: 10px auto 0;
    padding: 8px 12px;
    box-sizing: border-box;
    display: flex; align-items: center; justify-content: center;
    border-radius: 9px;
    text-align: center;
    font: 700 clamp(11px, 3vw, 14px)/1.35 Arial, sans-serif;
    color: #46564c;
    background: var(--jg-eef4ef, #EEF4EF);
    border: 1px solid var(--jg-dce6de, #DCE6DE);
}
.bu__msg--premiado { background: var(--jg-e3f5e6, #E3F5E6); border-color: var(--jg-9fd8ab, #9FD8AB); color: var(--jg-14532d, #14532d); }
.bu__msg--consolo  { background: #F1F3F1; border-color: #CDD5CE; color: #4F5A52; }
.bu__msg b { color: var(--jg-0a7a00, #0A7A00); }
.bu__msg--consolo b { color: #5C6B60; }

/* ---------------- vitrine ---------------- */

.bu__premios {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 10px;
    margin: 14px auto 0; max-width: 640px;
}
.bu__titulo-vitrine {
    width: 100%; text-align: center;
    font: 700 13px/1.3 Arial, sans-serif; color: var(--jg-14532d, #14532d); margin-bottom: 2px;
}
.bu__premio { width: 74px; text-align: center; font: 600 10px/1.2 Arial, sans-serif; color: #46564c; }
.bu__premio img { width: 100%; border-radius: 6px; display: block; margin-bottom: 3px; }

/* ---------------- movimento reduzido ---------------- */
@media (prefers-reduced-motion: reduce) {
    .bu--lente .bu__faixa { animation: none; opacity: 1; }
    .bu--lente .bu__lente { animation: none; transform: translate(-50%, -50%) scale(1) rotate(0deg); opacity: 1; }
    .bu--carimbo .bu__carimbo { animation: none; transform: translate(-50%, -50%) rotate(-14deg) scale(1); opacity: .93; }
    .bu--carimbo .bu__janela { animation: none; }
    .bu--placa .bu__placa { animation: none; transform: translate(-50%, 0); opacity: 1; }
}
