/* Centrifugação premiada (lavanderia).
 *
 * As cores de MARCA vêm como var(--jg-<hex>, #<hex>) para o whitelabel; dourado,
 * cinzas, azulejo, madeira e as cores das roupas ficam em hex direto.
 *
 * Contrato:
 *  - Estado FINAL por classe estática ou @keyframes … forwards (transição CSS não
 *    roda sob tempo virtual e some das capturas).
 *  - Movimento reduzido para cada coisa num estado VISÍVEL (o headless declara
 *    reduced-motion; é esse bloco que as capturas mostram).
 *  - A faixa de mensagem reserva a altura das duas linhas desde o início.
 *  - O giro do tambor é JS (setTimeout + relógio real); aqui só a porta, a bolha
 *    do prêmio, os raios, os brilhos e a placa.
 *  - Posições das camadas HTML em % do palco: o SVG usa viewBox 250×200 com o
 *    mesmo 5:4 do palco, então (x/250, y/200) vale direto. Tambor em (125,118).
 */

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

/* Rótulo do produto. NÃO é nome de prêmio — a bancada testa isso. */
.lv__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;
}
.lv__rotulo img { width: 12px; height: 12px; }

/* ---------------- a máquina ---------------- */

.lv__visor {
    font: 700 7px/1 Consolas, 'Courier New', monospace;
    fill: var(--jg-7dffa8, #7DFFA8);
    letter-spacing: .3px;
}

/* A porta gira na dobradiça (borda esquerda do aro). scaleX negativo é a
   projeção de uma porta que passou de 90° e ficou aberta para o lado. */
.lv__porta { transform-box: fill-box; transform-origin: 0% 50%; }
.lv--aberta .lv__porta { animation: lv-porta var(--lv-porta, .65s) cubic-bezier(.35, .1, .3, 1) forwards; }
@keyframes lv-porta {
    0%   { transform: scaleX(1); }
    12%  { transform: scaleX(.97) translateX(1px); }   /* o tranco da trava soltando */
    100% { transform: scaleX(-.36); }
}

/* ---------------- o que sai do tambor ---------------- */

/* Bolha do prêmio: nasce vazia e minúscula no centro do tambor. */
.lv__bolha {
    position: absolute;
    left: 50%; top: 59%;
    width: 25%;
    aspect-ratio: 1;
    border-radius: 50%;
    overflow: hidden;
    background: #fff;
    border: 3px solid #D4AF37;
    box-shadow: 0 0 0 3px rgba(255, 243, 196, .9), 0 10px 22px -8px rgba(0, 0, 0, .55);
    transform: translate(-50%, -50%) scale(.1);
    opacity: 0;
    z-index: 6;
}
.lv__bolha img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lv--premiou .lv__bolha { animation: lv-bolha var(--lv-revela, .55s) cubic-bezier(.3, 1.4, .5, 1) forwards; }
@keyframes lv-bolha {
    0%   { transform: translate(-50%, -50%) scale(.1); opacity: 0; }
    40%  { opacity: 1; }
    100% { transform: translate(-50%, -62%) scale(1.25); opacity: 1; }
}

/* Raios dourados atrás da bolha (só no prêmio). */
.lv__raios {
    position: absolute;
    left: 50%; top: 52%;
    width: 60%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: repeating-conic-gradient(from 0deg, rgba(244, 211, 94, .55) 0deg 10deg, rgba(244, 211, 94, 0) 10deg 30deg);
    -webkit-mask: radial-gradient(circle, #000 20%, transparent 70%);
            mask: radial-gradient(circle, #000 20%, transparent 70%);
    transform: translate(-50%, -50%) scale(.2);
    opacity: 0;
    z-index: 5;
    pointer-events: none;
}
.lv--premiou .lv__raios { animation: lv-raios 3.2s ease-out forwards; }
@keyframes lv-raios {
    0%   { transform: translate(-50%, -50%) scale(.2) rotate(0deg); opacity: 0; }
    20%  { opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1) rotate(60deg); opacity: .85; }
}

/* Brilhos de roupa limpa (só no consolo). O pai só tem <i>, então nth-child é seguro. */
.lv__brilhos { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.lv__brilhos i {
    position: absolute;
    width: 5%; 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, 236, 150, .9));
    transform: scale(0);
    opacity: 0;
}
.lv__brilhos i:nth-child(1) { left: 40%; top: 46%; }
.lv__brilhos i:nth-child(2) { left: 56%; top: 50%; width: 3.5%; }
.lv__brilhos i:nth-child(3) { left: 45%; top: 64%; width: 4%; }
.lv__brilhos i:nth-child(4) { left: 57%; top: 66%; width: 6%; }
.lv--consolo .lv__brilhos i { animation: lv-brilho 1.4s ease-out forwards; }
.lv--consolo .lv__brilhos i:nth-child(2) { animation-delay: .15s; }
.lv--consolo .lv__brilhos i:nth-child(3) { animation-delay: .3s; }
.lv--consolo .lv__brilhos i:nth-child(4) { animation-delay: .45s; }
@keyframes lv-brilho {
    0%   { transform: scale(0) rotate(0deg); opacity: 0; }
    40%  { transform: scale(1.2) rotate(30deg); opacity: 1; }
    100% { transform: scale(.9) rotate(45deg); opacity: .9; }
}

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

.lv__placa {
    position: absolute;
    left: 50%; bottom: 3%;
    width: 58%;
    transform: translate(-50%, 16px);
    opacity: 0;
    display: flex; align-items: center; justify-content: center;
    padding: 6px 9px;
    box-sizing: border-box;
    border-radius: 8px;
    background: linear-gradient(180deg, #FFF8DC, #F5E3A1);   /* dourado não entra no tema */
    border: 1.5px solid #C9A227;
    box-shadow: 0 8px 16px -8px rgba(0, 0, 0, .6);
    text-align: center;
    z-index: 9;
}
.lv__placa div { font: 700 clamp(11px, 2.8vw, 13px)/1.25 Arial, sans-serif; color: var(--jg-14532d, #14532d); min-width: 0; }
.lv__placa small { display: block; font: 700 9px/1.2 Arial, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: #8A6D1F; margin-bottom: 2px; }
.lv--placa .lv__placa { animation: lv-placa .5s cubic-bezier(.3, 1.3, .5, 1) forwards; }
@keyframes lv-placa { to { transform: translate(-50%, 0); opacity: 1; } }

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

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

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

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

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

/* ---------------- movimento reduzido ----------------
   Cada coisa PARA num estado visível que conta a mesma história. */
@media (prefers-reduced-motion: reduce) {
    .lv--aberta .lv__porta { animation: none; transform: scaleX(-.36); }
    .lv--premiou .lv__bolha { animation: none; transform: translate(-50%, -62%) scale(1.25); opacity: 1; }
    .lv--premiou .lv__raios { animation: none; transform: translate(-50%, -50%) scale(1); opacity: .85; }
    .lv--consolo .lv__brilhos i { animation: none; transform: scale(1); opacity: .9; }
    .lv--placa .lv__placa { animation: none; transform: translate(-50%, 0); opacity: 1; }
}
