/* Caixinha de petiscos (pet shops e clínicas veterinárias).
 *
 * Cores de MARCA como var(--jg-<hex>, #<hex>): pacote e tigela; parede, piso,
 * ração e dourado em hex direto. Nunca azul.
 *
 * Contrato:
 *  - Estado FINAL por classe estática ou @keyframes … forwards.
 *  - Movimento reduzido: cada coisa para num estado VISÍVEL.
 *  - Lacre, topo, inclinação e grãos são JS (atributos SVG); aqui só o osso,
 *    a placa e os confetes.
 *  - Posições em % do palco: viewBox 160×110 no mesmo 16:11 do palco. Boca do
 *    pacote inclinado em (103.7, 48.3) → 64.8% / 43.9%.
 */

.cp__palco {
    position: relative;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    aspect-ratio: 16 / 11;
    border-radius: 14px;
    overflow: hidden;
    background: #FFF4E2;
    box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .45);
    user-select: none;
    font-family: Arial, sans-serif;
}
.cp__cena { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.cp__etiq { font: 900 4px/1 Arial, sans-serif; fill: var(--jg-14532d, #14532d); letter-spacing: .5px; }
.cp__boca { opacity: 0; }
.cp--aberto .cp__boca { opacity: 1; }

.cp__rotulo {
    position: absolute;
    left: 3%; top: 4%;
    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;
}
.cp__rotulo img { width: 12px; height: 12px; }

/* ---------------- o petisco dourado (osso) ---------------- */

.cp__osso {
    position: absolute;
    left: 64.8%; top: 43.9%;
    width: 38%;
    aspect-ratio: 3.4;
    transform: translate(-50%, -50%) scale(.15) rotate(-30deg);
    opacity: 0;
    z-index: 7;
    filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .35)) drop-shadow(0 0 10px rgba(255, 214, 90, .7));
}
/* barra do osso */
.cp__osso::before {
    content: '';
    position: absolute;
    left: 12%; right: 12%; top: 26%; bottom: 26%;
    border-radius: 6px;
    background: linear-gradient(180deg, #FFF3B0, #F4C430 55%, #C9961A);
}
/* pontas: duas bolinhas em cada lado */
.cp__osso-ponta { position: absolute; top: 0; bottom: 0; width: 22%; }
.cp__osso-ponta--e { left: 0; }
.cp__osso-ponta--d { right: 0; }
.cp__osso-ponta::before, .cp__osso-ponta::after {
    content: '';
    position: absolute;
    left: 0; width: 100%;
    height: 56%;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 35%, #FFF6C8, #F4C430 55%, #C9961A);
}
.cp__osso-ponta::before { top: 0; }
.cp__osso-ponta::after { bottom: 0; }
.cp__medalhao {
    position: absolute;
    left: 50%; top: 50%;
    height: 150%;
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    overflow: hidden;
    background: #fff;
    border: 3px solid #D4AF37;
    box-shadow: 0 0 0 2px #FFF6D8;
}
.cp__medalhao img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cp--premiou .cp__osso { animation: cp-salta var(--cp-osso, .75s) cubic-bezier(.3, 1.2, .5, 1) forwards; }
@keyframes cp-salta {
    0%   { left: 64.8%; top: 43.9%; opacity: 0; transform: translate(-50%, -50%) scale(.15) rotate(-30deg); }
    20%  { opacity: 1; }
    55%  { left: 56%; top: 20%; transform: translate(-50%, -50%) scale(.85) rotate(8deg); }
    100% { left: 50%; top: 27%; opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(-4deg); }
}

/* ---------------- confetes ---------------- */

.cp__confetes { position: absolute; inset: 0; pointer-events: none; z-index: 6; }
.cp__confetes i { position: absolute; left: 50%; top: 27%; width: 1.7%; height: 2.6%; border-radius: 1px; opacity: 0; }
.cp--premiou .cp__confetes i { animation: cp-confete 1.3s .35s cubic-bezier(.2, .7, .4, 1) forwards; }
@keyframes cp-confete {
    0%   { opacity: 0; transform: rotate(0deg); }
    15%  { opacity: 1; }
    100% { opacity: 1; left: calc(50% + var(--dx)); top: calc(27% + var(--dy)); transform: rotate(var(--r)); }
}

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

.cp__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);
    border: 1.5px solid #C9A227;
    box-shadow: 0 8px 16px -8px rgba(0, 0, 0, .6);
    text-align: center;
    z-index: 9;
}
.cp__placa div { font: 700 clamp(11px, 2.8vw, 13px)/1.25 Arial, sans-serif; color: var(--jg-14532d, #14532d); min-width: 0; }
.cp__placa small { display: block; font: 700 9px/1.2 Arial, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: #8A6D1F; margin-bottom: 2px; }
.cp--placa .cp__placa { animation: cp-placa .5s cubic-bezier(.3, 1.3, .5, 1) forwards; }
@keyframes cp-placa { to { transform: translate(-50%, 0); opacity: 1; } }

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

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

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

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

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

/* ---------------- movimento reduzido ---------------- */
@media (prefers-reduced-motion: reduce) {
    .cp--premiou .cp__osso { animation: none; left: 50%; top: 27%; opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(-4deg); }
    .cp--premiou .cp__confetes i { animation: none; opacity: 1; left: calc(50% + var(--dx)); top: calc(27% + var(--dy)); transform: rotate(var(--r)); }
    .cp--placa .cp__placa { animation: none; transform: translate(-50%, 0); opacity: 1; }
}
