/* Ticket premium (farmácias e drogarias, totem de senhas).
 *
 * Cores de MARCA como var(--jg-<hex>, #<hex>): faixa do totem, cruz, botões e
 * textos do ticket; papel, holograma (ouro, rosa, lilás, menta) e parede em hex
 * direto. Nunca azul.
 *
 * Contrato:
 *  - Estado FINAL por classe estática ou @keyframes … forwards.
 *  - Movimento reduzido: cada coisa para num estado VISÍVEL.
 *  - Papel saindo e aproximação da câmera são JS (transform), pelo relógio; a
 *    câmera tem origem 0 0 e nada de will-change (texto nítido).
 *  - Posições em % do palco: viewBox 160×110 no mesmo 16:11. Boca da impressora
 *    em y ≈ 86 → o papel nasce a 22% do fundo; 20% de largura.
 *  - O ticket tem as linhas em %: a parte de cima (até o picote) ocupa 51% da
 *    altura, abaixo dos 54% que saem na fase A.
 */

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

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

.tk--jogando .tk__led { animation: tk-led .5s steps(2) infinite; }
@keyframes tk-led { 50% { opacity: .2; } }

/* ---------------- o papel ---------------- */

.tk__saida {
    position: absolute;
    left: 50%; bottom: 22%;
    width: 17%; height: 60%;
    transform: translateX(-50%);
    overflow: hidden;
    z-index: 2;
}
.tk--cortou .tk__saida { overflow: visible; animation: tk-solta .45s ease-out forwards; }
@keyframes tk-solta { to { transform: translateX(-50%) translateY(-2.5%) rotate(-2.5deg); } }

.tk__papel {
    position: absolute; inset: 0;
    box-sizing: border-box;
    display: grid;
    grid-template-rows: 12% 6% 16% 6% 7% 4% 1fr 7%;
    padding: 0 6%;
    background: linear-gradient(180deg, #FFFFFF, #FBFAF4);
    box-shadow: 0 4px 10px -4px rgba(0, 0, 0, .35);
    color: #2E3A33;
    text-align: center;
    transform: translateY(100%);
}
.tk__topo { display: flex; align-items: center; justify-content: center; gap: 3px; border-bottom: 1px solid #E3E8E4; font: 700 6.5px/1 Arial, sans-serif; letter-spacing: .06em; text-transform: uppercase; color: var(--jg-0a7a00, #0A7A00); }
.tk__topo img { width: 8px; height: 8px; }
.tk__rotulo-senha { align-self: end; font: 700 5px/1 Arial, sans-serif; letter-spacing: .16em; color: #7A8A80; }
.tk__senha { align-self: center; font: 700 22px/1 'Courier New', Consolas, monospace; letter-spacing: .02em; color: var(--jg-1e2a22, #1E2A22); white-space: nowrap; }
.tk__fila { align-self: center; font: 700 5.6px/1 Arial, sans-serif; color: var(--jg-14532d, #14532d); white-space: nowrap; overflow: hidden; }
.tk__aguarde { align-self: center; font: 400 4.8px/1.2 Arial, sans-serif; color: #6B7A70; }
.tk__picote { align-self: center; border-top: 1px dashed #C5CEC9; }
.tk__rodape { align-self: center; font: italic 400 4.8px/1 Georgia, serif; color: #7A8A80; }

.tk__resultado { position: relative; display: flex; align-items: center; justify-content: center; }
.tk__saude { display: flex; flex-direction: column; gap: 4px; padding: 6% 4%; border: 1px solid var(--jg-dde6e0, #DDE6E0); border-radius: 4px; background: #F5FAF6; }
.tk__saude small { font: 700 4.6px/1 Arial, sans-serif; letter-spacing: .12em; text-transform: uppercase; color: var(--jg-0a7a00, #0A7A00); }
.tk__saude span { font: italic 700 6.4px/1.3 Georgia, serif; color: #33443A; }

.tk__premiado { display: flex; flex-direction: column; align-items: center; gap: 3px; padding-top: 14px; }
.tk__premiado img { width: 32px; height: 32px; object-fit: cover; border-radius: 50%; border: 1.5px solid #D4AF37; background: #fff; }
.tk__premiado small { display: block; font: 700 4.6px/1 Arial, sans-serif; letter-spacing: .12em; text-transform: uppercase; color: #8A6D1F; }
.tk__premiado b { display: block; margin-top: 2px; font: 700 8px/1.15 Georgia, serif; color: var(--jg-14532d, #14532d); overflow-wrap: anywhere; }

/* marca d'água holográfica e carimbo (só no prêmio) */
.tk__holo {
    position: absolute; inset: 0;
    background: linear-gradient(115deg, rgba(253, 230, 138, 0) 20%, rgba(253, 230, 138, .55) 35%, rgba(249, 198, 222, .5) 45%, rgba(217, 204, 245, .5) 55%, rgba(var(--jg-rgb-bdefd8, 189,239,216), .5) 65%, rgba(253, 241, 184, 0) 80%);
    background-size: 250% 100%;
    background-position: 100% 0;
    mix-blend-mode: multiply;
    opacity: 0;
    pointer-events: none;
}
.tk--premiou .tk__holo { animation: tk-holo 1.6s ease-in-out .2s infinite alternate; }
@keyframes tk-holo { from { opacity: .9; background-position: 100% 0; } to { opacity: .9; background-position: 0 0; } }

.tk__carimbo {
    position: absolute;
    left: 50%; top: 11%;
    padding: 2px 5px;
    border: 1.5px solid #9A7414;
    border-radius: 3px;
    background: linear-gradient(115deg, #FFF3B0, #F9C6DE 35%, #D9CCF5 60%, var(--jg-bdefd8, #BDEFD8) 80%, #FDE68A);
    box-shadow: 0 0 6px 1px rgba(255, 214, 90, .7);
    font: 700 5.4px/1.1 Arial, sans-serif;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--jg-14532d, #14532d);
    white-space: nowrap;
    transform: translate(-50%, -50%) rotate(-10deg) scale(2.2);
    opacity: 0;
}
.tk--premiou .tk__carimbo { animation: tk-carimbo var(--tk-carimbo, .6s) cubic-bezier(.5, 0, .7, 1) forwards; }
@keyframes tk-carimbo {
    0%   { transform: translate(-50%, -50%) rotate(-10deg) scale(2.2); opacity: 0; }
    70%  { transform: translate(-50%, -50%) rotate(-10deg) scale(.94); opacity: 1; }
    100% { transform: translate(-50%, -50%) rotate(-10deg) scale(1); opacity: 1; }
}

/* lábio da boca da impressora na frente do papel, e o corte */
.tk__labio {
    position: absolute;
    left: 50%; bottom: 20.2%;
    width: 21%; height: 2.2%;
    transform: translateX(-50%);
    border-radius: 0 0 4px 4px;
    background: #3A4541;
    z-index: 3;
}
.tk__lamina {
    position: absolute;
    left: 50%; bottom: 21.6%;
    width: 20%; height: 3px;
    transform: translateX(-50%) scaleX(0);
    background: #FFFFFF;
    box-shadow: 0 0 6px 2px rgba(255, 255, 255, .9);
    opacity: 0;
    z-index: 4;
}
.tk--cortou .tk__lamina { animation: tk-corte .35s ease-out forwards; }
@keyframes tk-corte { 0% { opacity: 1; transform: translateX(-50%) scaleX(0); } 60% { opacity: 1; transform: translateX(-50%) scaleX(1); } 100% { opacity: 0; transform: translateX(-50%) scaleX(1); } }

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

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

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

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

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

/* ---------------- movimento reduzido ---------------- */
@media (prefers-reduced-motion: reduce) {
    .tk--jogando .tk__led { animation: none; }
    .tk--cortou .tk__saida { animation: none; transform: translateX(-50%) translateY(-2.5%) rotate(-2.5deg); }
    .tk--cortou .tk__lamina { animation: none; }
    .tk--premiou .tk__holo { animation: none; opacity: .9; background-position: 50% 0; }
    .tk--premiou .tk__carimbo { animation: none; transform: translate(-50%, -50%) rotate(-10deg) scale(1); opacity: 1; }
}
