/* Café perfeito (lojas de eletrodomésticos, cafeteira de cápsula).
 *
 * Cores de MARCA como var(--jg-<hex>, #<hex>): rótulo e botões (a marca da loja
 * vai na xícara); cafeteira grafite, cápsula cobre, café, espuma 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.
 *  - Cápsula, alavanca, jato e nível são JS (atributos no SVG), pelo relógio;
 *    aqui a vista de cima (igual nas duas), a estrela dourada e o cartão.
 */

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

.ca__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;
}
.ca__rotulo img { width: 12px; height: 12px; }
.ca--jogando .ca__led { animation: ca-led .6s steps(2) infinite; }
@keyframes ca-led { 50% { opacity: .25; } }

/* ---------------- vista de cima (nas duas, depois da resposta) ---------------- */

.ca__vista {
    position: absolute;
    left: 75%; top: 46%;
    width: 36%;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    transform: translate(-50%, -50%) scale(.6);
    opacity: 0;
    z-index: 4;
}
.ca__vista svg { width: 100%; display: block; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .25)); }
.ca__vista small { font: italic 700 clamp(11px, 3vw, 15px)/1 Georgia, 'Times New Roman', serif; color: #5E3A22; opacity: 0; }
.ca--vista .ca__vista { animation: ca-vista var(--ca-vista, .5s) ease-out forwards; }
@keyframes ca-vista { to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
.ca--consolo .ca__vista small { animation: ca-aparece .5s .2s ease-out forwards; }
@keyframes ca-aparece { to { opacity: 1; } }

/* a estrela dourada desenhada na espuma (só no prêmio) */
.ca__estrela { stroke-dasharray: 1 1; stroke-dashoffset: 1; fill-opacity: 0; opacity: 0; }
.ca--premiou .ca__estrela { animation: ca-estrela 1s ease-out forwards; }
@keyframes ca-estrela {
    0%   { opacity: 1; stroke-dashoffset: 1; fill-opacity: 0; }
    60%  { opacity: 1; stroke-dashoffset: 0; fill-opacity: 0; }
    100% { opacity: 1; stroke-dashoffset: 0; fill-opacity: 1; }
}

.ca__faixa {
    position: absolute;
    left: 75%; top: 8%;
    padding: 1% 4%;
    border-radius: 999px;
    background: linear-gradient(180deg, #FFF3B0, #F4C430 55%, #D49A12);
    border: 1.5px solid #FFF6D8;
    box-shadow: 0 0 0 1.2px #9A7414, 0 0 14px 4px rgba(255, 214, 90, .55);
    font: 700 clamp(10px, 2.8vw, 14px)/1.1 Georgia, 'Times New Roman', serif;
    color: var(--jg-14532d, #14532d);
    white-space: nowrap;
    transform: translate(-50%, 0) scale(.6);
    opacity: 0;
    z-index: 5;
}
.ca--premiou .ca__faixa { animation: ca-faixa .5s .6s cubic-bezier(.3, 1.4, .5, 1) forwards; }
@keyframes ca-faixa { to { transform: translate(-50%, 0) scale(1); opacity: 1; } }

.ca__cartao {
    position: absolute;
    left: 75%; top: 86%;
    width: 46%;
    display: flex; align-items: center; gap: 6%;
    padding: 2% 3%;
    box-sizing: border-box;
    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;
}
.ca__cartao img { width: 24%; aspect-ratio: 1; object-fit: cover; border-radius: 50%; border: 2px solid #FFFFFF; background: #fff; flex: none; }
.ca__cartao div { min-width: 0; font: 700 clamp(11px, 3vw, 15px)/1.2 Georgia, 'Times New Roman', serif; color: var(--jg-14532d, #14532d); }
.ca__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; }
.ca__cartao span { display: block; overflow-wrap: anywhere; }
.ca--premiou .ca__cartao { animation: ca-cartao .6s .9s cubic-bezier(.3, 1.3, .5, 1) forwards; }
@keyframes ca-cartao { to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }

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

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

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

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

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

/* ---------------- movimento reduzido ---------------- */
@media (prefers-reduced-motion: reduce) {
    .ca--jogando .ca__led { animation: none; }
    .ca--vista .ca__vista { animation: none; transform: translate(-50%, -50%) scale(1); opacity: 1; }
    .ca--consolo .ca__vista small { animation: none; opacity: 1; }
    .ca--premiou .ca__estrela { animation: none; opacity: 1; stroke-dashoffset: 0; fill-opacity: 1; }
    .ca--premiou .ca__faixa { animation: none; transform: translate(-50%, 0) scale(1); opacity: 1; }
    .ca--premiou .ca__cartao { animation: none; transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
