/* Ambiente assinado (casa e decoração).
 *
 * Cores de MARCA como var(--jg-<hex>, #<hex>): a fita da caixa de presente e os
 * botões; parede, piso, móveis (sálvia, mostarda, madeira), luz e dourado em
 * hex direto. Nunca azul. Nenhum preço nem marca nos móveis.
 *
 * Contrato:
 *  - Estado FINAL por classe estática ou @keyframes … forwards.
 *  - Movimento reduzido: cada coisa para num estado VISÍVEL.
 *  - Os móveis entram por JS (opacity/transform nos <g>); o take de câmera é JS
 *    (scale no wrapper, origem na mesa de centro, sem will-change para o texto
 *    ficar nítido).
 *  - Posições em % do palco: viewBox 160×110 no mesmo 16:11 do palco. Mesa de
 *    centro em (80,84) → 50% / 76%.
 */

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

.aa__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;
}
.aa__rotulo img { width: 12px; height: 12px; }

/* ---------------- feixe de luz (só no prêmio) ---------------- */

.aa__feixe {
    position: absolute;
    left: 50%; top: 0;
    width: 36%; height: 76%;
    transform: translateX(-50%);
    clip-path: polygon(44% 0, 56% 0, 100% 100%, 0 100%);
    background: linear-gradient(180deg, rgba(255, 244, 200, .9), rgba(255, 226, 140, .25) 80%, rgba(255, 226, 140, 0));
    opacity: 0;
    z-index: 2;
    pointer-events: none;
}
.aa--premiou .aa__feixe { animation: aa-feixe .5s ease-out forwards; }
@keyframes aa-feixe { to { opacity: .9; } }

/* ---------------- caixa de presente ---------------- */

.aa__presente {
    position: absolute;
    left: 50%; top: 75%;
    width: 12%;
    aspect-ratio: 1;
    transform: translate(-50%, -100%);
    opacity: 0;
    z-index: 5;
}
.aa__caixa {
    position: absolute; left: 0; right: 0; bottom: 0; height: 72%;
    border-radius: 3px;
    background:
        linear-gradient(90deg, rgba(0, 0, 0, 0) 42%, var(--jg-0a7a00, #0A7A00) 42% 58%, rgba(0, 0, 0, 0) 58%),
        linear-gradient(180deg, #FFF3B0, #E0B43A);
    box-shadow: 0 6px 10px -4px rgba(0, 0, 0, .4);
}
.aa__tampa {
    position: absolute; left: -8%; right: -8%; top: 12%; height: 22%;
    border-radius: 3px;
    background:
        linear-gradient(90deg, rgba(0, 0, 0, 0) 42%, var(--jg-0a7a00, #0A7A00) 42% 58%, rgba(0, 0, 0, 0) 58%),
        linear-gradient(180deg, #FFF6C8, #E8C04E);
    box-shadow: 0 3px 5px -2px rgba(0, 0, 0, .35);
}
.aa__tampa::before, .aa__tampa::after {
    content: ''; position: absolute; top: -70%; width: 34%; height: 80%;
    border: 2.5px solid var(--jg-0a7a00, #0A7A00); border-radius: 50% 50% 0 50%;
}
.aa__tampa::before { left: 16%; transform: rotate(-20deg); }
.aa__tampa::after  { right: 16%; transform: scaleX(-1) rotate(-20deg); }
.aa--premiou .aa__presente { animation: aa-surge .45s ease-out forwards; }
@keyframes aa-surge { to { opacity: 1; } }
.aa--abre .aa__presente { animation: aa-flutua var(--aa-caixa, .7s) cubic-bezier(.3, 1.1, .5, 1) forwards; }
@keyframes aa-flutua { from { opacity: 1; top: 75%; } to { opacity: 1; top: 62%; } }
.aa--abre .aa__tampa { animation: aa-tampa var(--aa-caixa, .7s) ease-out forwards; }
@keyframes aa-tampa { to { transform: translate(40%, -180%) rotate(28deg); opacity: 0; } }

/* o cartão com o prêmio sai de dentro da caixa */
.aa__cartao {
    position: absolute;
    left: 50%; bottom: 60%;
    width: 380%;
    display: flex; align-items: center; gap: 6%;
    padding: 8% 10%;
    box-sizing: border-box;
    border-radius: 10px;
    background: linear-gradient(180deg, #FFF8DC, #F5E3A1);
    border: 1.5px solid #C9A227;
    box-shadow: 0 10px 18px -8px rgba(0, 0, 0, .5), 0 0 18px 3px rgba(255, 214, 90, .5);
    transform: translate(-50%, 40%) scale(.1);
    opacity: 0;
}
.aa__cartao img { width: 30%; aspect-ratio: 1; object-fit: cover; border-radius: 50%; border: 2px solid #D4AF37; background: #fff; flex: none; }
.aa__cartao div { min-width: 0; font: 700 clamp(10px, 2.8vw, 14px)/1.2 Georgia, 'Times New Roman', serif; color: var(--jg-14532d, #14532d); }
.aa__cartao small { display: block; font: 700 clamp(7px, 1.8vw, 9px)/1.2 Arial, sans-serif; letter-spacing: .1em; text-transform: uppercase; color: #8A6D1F; margin-bottom: 2px; }
.aa__cartao span { display: block; overflow-wrap: anywhere; }
.aa--abre .aa__cartao { animation: aa-cartao .6s .25s cubic-bezier(.3, 1.3, .5, 1) forwards; }
@keyframes aa-cartao { to { transform: translate(-50%, 0) scale(1); opacity: 1; } }

.aa__brilhos { position: absolute; inset: 0; pointer-events: none; z-index: 6; }
.aa__brilhos i {
    position: absolute;
    width: 4%; aspect-ratio: 1;
    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));
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
}
.aa--abre .aa__brilhos i { animation: aa-estrela 1s ease-out forwards; }
@keyframes aa-estrela {
    0%   { opacity: 0; transform: translate(-50%, -50%) scale(0) rotate(0deg); }
    45%  { opacity: 1; transform: translate(-50%, -50%) scale(1.25) rotate(30deg); }
    100% { opacity: .95; transform: translate(-50%, -50%) scale(.9) rotate(45deg); }
}

/* ---------------- frase de inspiração (só sem prêmio) ---------------- */

.aa__frase {
    position: absolute;
    left: 50%; top: 2.5%;
    width: max-content;
    max-width: 84%;
    padding: 1.6% 5%;
    transform: translate(-50%, -8px);
    border-top: 1px solid #C9A227; border-bottom: 1px solid #C9A227;
    background: rgba(255, 252, 245, .85);
    font: italic 700 clamp(12px, 3.4vw, 17px)/1.25 Georgia, 'Times New Roman', serif;
    color: #4A3A28;
    text-align: center;
    opacity: 0;
    z-index: 7;
}
.aa--consolo .aa__frase { animation: aa-frase .6s ease-out forwards; }
@keyframes aa-frase { to { transform: translate(-50%, 0); opacity: 1; } }

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

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

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

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

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

/* ---------------- movimento reduzido ---------------- */
@media (prefers-reduced-motion: reduce) {
    .aa--premiou .aa__feixe { animation: none; opacity: .9; }
    .aa--premiou .aa__presente { animation: none; opacity: 1; }
    .aa--abre .aa__presente { animation: none; opacity: 1; top: 62%; }
    .aa--abre .aa__tampa { animation: none; transform: translate(40%, -180%) rotate(28deg); opacity: 0; }
    .aa--abre .aa__cartao { animation: none; transform: translate(-50%, 0) scale(1); opacity: 1; }
    .aa--abre .aa__brilhos i { animation: none; opacity: .95; transform: translate(-50%, -50%) scale(.9) rotate(45deg); }
    .aa--consolo .aa__frase { animation: none; transform: translate(-50%, 0); opacity: 1; }
}
