/* Unboxing premium (lojas de eletrodomésticos e eletroportáteis).
 *
 * Cores de MARCA como var(--jg-<hex>, #<hex>): fita da caixa, rótulo e botões;
 * kraft, aparelho preto, plástico, holograma e ouro em hex direto. Nunca azul.
 *
 * Contrato:
 *  - Estado FINAL por classe estática ou @keyframes … forwards.
 *  - Movimento reduzido: cada coisa para num estado VISÍVEL.
 *  - Fita, abas, aparelho e plástico são JS (atributos no SVG), pelo relógio;
 *    aqui o selo holográfico e o cartão (prêmio) ou o manual (sem prêmio).
 *  - Posições em % do palco: viewBox 160×110 no mesmo 16:11. Visor do aparelho
 *    fora da caixa em (80,24) → 50% / 21,8%.
 */

.ub__palco {
    position: relative;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    aspect-ratio: 16 / 11;
    border-radius: 14px;
    overflow: hidden;
    background: #EDEAE5;
    box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .45);
    user-select: none;
    font-family: Arial, sans-serif;
}
.ub__cena { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.ub__rotulo {
    position: absolute;
    left: 2%; bottom: 2%;
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 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;
}
.ub__rotulo img { width: 12px; height: 12px; }

/* ---------------- selo holográfico no visor (só no prêmio) ---------------- */

.ub__selo {
    position: absolute;
    left: 50%; top: 22%;
    width: 17%; aspect-ratio: 1;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    text-align: center;
    background:
        repeating-conic-gradient(from 0deg, rgba(255, 255, 255, .0) 0 10deg, rgba(255, 255, 255, .35) 10deg 20deg),
        linear-gradient(135deg, #FDE68A, #F9C6DE 30%, #D9CCF5 55%, var(--jg-bdefd8, #BDEFD8) 78%, #FFF3B0);
    border: 2px solid #FFF6D8;
    box-shadow: 0 0 0 1.4px #9A7414, 0 0 16px 4px rgba(255, 214, 90, .65);
    transform: translate(-50%, -50%) scale(2.2) rotate(-20deg);
    opacity: 0;
    z-index: 5;
}
.ub__selo span { font: 700 clamp(8px, 2.2vw, 11px)/1.05 Georgia, 'Times New Roman', serif; color: var(--jg-14532d, #14532d); text-transform: uppercase; letter-spacing: .04em; padding: 0 12%; }
.ub--premiou .ub__selo { animation: ub-selo .5s cubic-bezier(.5, 0, .7, 1) forwards, ub-holo 1.6s .6s ease-in-out infinite alternate; }
@keyframes ub-selo {
    0%   { transform: translate(-50%, -50%) scale(2.2) rotate(-20deg); opacity: 0; }
    70%  { transform: translate(-50%, -50%) scale(.94) rotate(-8deg); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1) rotate(-8deg); opacity: 1; }
}
@keyframes ub-holo { from { filter: hue-rotate(0deg); } to { filter: hue-rotate(-40deg) brightness(1.08); } }

.ub__faiscas { position: absolute; left: 50%; top: 22%; width: 0; height: 0; z-index: 6; pointer-events: none; }
.ub__faiscas i {
    position: absolute; left: 0; top: 0;
    width: 10px; height: 10px; margin: -5px 0 0 -5px;
    background: #FFF6C9;
    clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
    filter: drop-shadow(0 0 3px rgba(255, 214, 90, .95));
    opacity: 0;
}
.ub__faiscas i:nth-child(1) { --dx: -70px; --dy: -24px; }
.ub__faiscas i:nth-child(2) { --dx: 70px;  --dy: -30px; animation-delay: .05s; }
.ub__faiscas i:nth-child(3) { --dx: -84px; --dy: 30px;  animation-delay: .1s; }
.ub__faiscas i:nth-child(4) { --dx: 86px;  --dy: 26px;  animation-delay: .07s; }
.ub__faiscas i:nth-child(5) { --dx: -30px; --dy: -50px; animation-delay: .12s; }
.ub__faiscas i:nth-child(6) { --dx: 34px;  --dy: -52px; animation-delay: .03s; }
.ub--premiou .ub__faiscas i { animation: ub-faisca .9s .35s ease-out forwards; }
@keyframes ub-faisca {
    0%   { transform: translate(0, 0) scale(.3) rotate(0deg); opacity: 0; }
    20%  { opacity: 1; }
    100% { transform: translate(var(--dx), var(--dy)) scale(1) rotate(60deg); opacity: .9; }
}

.ub__cartao {
    position: absolute;
    left: 84%; top: 46%;
    width: 27%;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 3% 2%;
    box-sizing: border-box;
    text-align: center;
    border-radius: 10px;
    background: linear-gradient(135deg, #FFF3B0, #F4C430 50%, #D49A12);
    border: 2px solid #FFF6D8;
    box-shadow: 0 0 0 1.5px #9A7414, 0 12px 20px -8px rgba(0, 0, 0, .5);
    transform: translate(-50%, -50%) scale(.1);
    opacity: 0;
    z-index: 6;
}
.ub__cartao img { width: 62%; aspect-ratio: 1; object-fit: cover; border-radius: 50%; border: 2px solid #FFFFFF; background: #fff; flex: none; }
.ub__cartao div { min-width: 0; font: 700 clamp(11px, 3vw, 15px)/1.2 Georgia, 'Times New Roman', serif; color: var(--jg-14532d, #14532d); }
.ub__cartao small { display: block; font: 700 clamp(8px, 2vw, 10px)/1.2 Arial, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: #6B4E0E; margin-bottom: 2px; }
.ub__cartao span { display: block; overflow-wrap: anywhere; }
.ub--premiou .ub__cartao { animation: ub-cartao .6s .7s cubic-bezier(.3, 1.3, .5, 1) forwards; }
@keyframes ub-cartao { to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }

/* ---------------- manual de instruções (só sem prêmio) ---------------- */

.ub__manual {
    position: absolute;
    left: 58%; top: 47%;
    width: 15%; aspect-ratio: 3 / 4;
    box-sizing: border-box;
    padding: 2.4% 2%;
    display: flex; flex-direction: column; gap: 6%;
    background: linear-gradient(180deg, #FFFFFF, #F1EEE8);
    border: 1px solid #D9D2C7;
    border-top: 4px solid var(--jg-0a7a00, #0A7A00);
    border-radius: 2px;
    box-shadow: 0 8px 14px -6px rgba(0, 0, 0, .4);
    transform: translate(-50%, -80%) rotate(-10deg);
    opacity: 0;
    z-index: 5;
}
.ub__manual b { font: 700 clamp(7px, 1.9vw, 9px)/1.15 Arial, sans-serif; color: #2E3A33; }
.ub__manual i { display: block; height: 2px; border-radius: 1px; background: #D9D2C7; }
.ub__manual i:nth-of-type(2) { width: 80%; }
.ub__manual i:nth-of-type(3) { width: 60%; }
.ub--consolo .ub__manual { animation: ub-manual .6s .15s cubic-bezier(.3, 1.2, .5, 1) forwards; }
@keyframes ub-manual { to { transform: translate(-50%, -50%) rotate(-8deg); opacity: 1; } }

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

.ub__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);
}
.ub__botao:hover:not(:disabled) { filter: brightness(1.06); }
.ub__botao:disabled { opacity: .55; cursor: default; }

.ub__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);
}
.ub__msg--premiado { background: var(--jg-e3f5e6, #E3F5E6); border-color: var(--jg-9fd8ab, #9FD8AB); color: var(--jg-14532d, #14532d); }
.ub__msg--consolo  { background: #F1F3F1; border-color: #CDD5CE; color: #4F5A52; }
.ub__msg b { color: var(--jg-0a7a00, #0A7A00); }
.ub__msg--consolo b { color: #5C6B60; }

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

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

/* ---------------- movimento reduzido ---------------- */
@media (prefers-reduced-motion: reduce) {
    .ub--premiou .ub__selo { animation: none; transform: translate(-50%, -50%) scale(1) rotate(-8deg); opacity: 1; }
    .ub--premiou .ub__faiscas i { animation: none; opacity: .9; transform: translate(var(--dx), var(--dy)) scale(1) rotate(60deg); }
    .ub--premiou .ub__cartao { animation: none; transform: translate(-50%, -50%) scale(1); opacity: 1; }
    .ub--consolo .ub__manual { animation: none; transform: translate(-50%, -50%) rotate(-8deg); opacity: 1; }
}
