/* Tudo é medido em cqw: 1cqw = 1% da largura do palco 9:16, então o layout é o mesmo em qualquer tela. */
* { box-sizing: border-box; margin: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; background: #000; overflow: hidden; user-select: none; touch-action: manipulation; }
body { display: grid; place-items: center; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--texto, #fff); }

#palco { position: relative; height: 100vh; aspect-ratio: 9 / 16; max-width: 100vw; container-type: size; overflow: hidden; background: #0b1c2c; }
@media (max-aspect-ratio: 9/16) { #palco { height: auto; width: 100vw; } }
#tela { position: absolute; inset: 0; width: 100%; height: 100%; }
#ui { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 5cqw; font-size: 3.4cqw; line-height: 1.4; }

small { font-size: 2.4cqw; letter-spacing: 0.22em; text-transform: uppercase; color: var(--destaque); font-weight: 600; }
h1 { font-size: 9.5cqw; line-height: 1.02; letter-spacing: -0.03em; font-weight: 700; margin: 1.5cqw 0 2cqw; text-shadow: 0 0.4cqw 3cqw rgba(0, 0, 0, 0.5); }
h2 { font-size: 6cqw; line-height: 1.1; letter-spacing: -0.02em; font-weight: 700; }
header p { max-width: 62cqw; text-shadow: 0 0.2cqw 2cqw rgba(0, 0, 0, 0.6); }

.painel { margin-top: auto; background: var(--painel); backdrop-filter: blur(3cqw); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 5cqw; padding: 4.5cqw; display: flex; flex-direction: column; gap: 2.6cqw; }
.campo { min-height: 11cqw; border-radius: 3cqw; background: rgba(255, 255, 255, 0.08); border: 0.3cqw solid rgba(255, 255, 255, 0.2); display: grid; place-items: center; font-size: 5.4cqw; font-weight: 600; letter-spacing: 0.02em; padding: 0 3cqw; text-align: center; }
.campo:empty::before { content: attr(data-vazio); font-size: 3.2cqw; font-weight: 400; opacity: 0.6; letter-spacing: 0; }
.campo.ativo { border-color: var(--destaque); }
.aviso { min-height: 1.4em; color: var(--destaque); text-align: center; font-weight: 600; }

button { font: inherit; color: inherit; border: 0; cursor: pointer; }
.principal { background: var(--destaque); color: var(--sobreDestaque); font-size: 4.4cqw; font-weight: 700; padding: 3.6cqw; border-radius: 99cqw; }
.principal:active, .teclado button:active { transform: scale(0.97); filter: brightness(1.15); }
.secundario { background: none; border: 0.3cqw solid rgba(255, 255, 255, 0.3); font-weight: 600; padding: 3cqw; border-radius: 99cqw; }
.linha { display: flex; gap: 2.5cqw; }
.linha > * { flex: 1; }
.linha > .principal { flex: 2; }

.teclado { display: flex; flex-direction: column; gap: 1.2cqw; }
.teclado div { display: flex; gap: 1.2cqw; justify-content: center; }
.teclado button { flex: 1; max-width: 9cqw; height: 9.4cqw; border-radius: 2cqw; background: rgba(255, 255, 255, 0.12); font-size: 4cqw; font-weight: 600; }
.teclado button.largo { max-width: 46cqw; font-size: 2.8cqw; font-weight: 500; }
.teclado.numeros button { max-width: 20cqw; height: 10cqw; }

.marcar { display: flex; align-items: center; gap: 2.5cqw; text-align: left; background: rgba(255, 255, 255, 0.07); border-radius: 3cqw; padding: 2.6cqw 3cqw; }
.marcar i { flex: none; width: 5.4cqw; height: 5.4cqw; border-radius: 1.4cqw; border: 0.4cqw solid rgba(255, 255, 255, 0.5); display: grid; place-items: center; font-style: normal; font-weight: 800; color: var(--sobreDestaque); }
.marcar.sim i { background: var(--destaque); border-color: var(--destaque); }
.marcar.sim i::before { content: "✓"; }
.consent p { opacity: 0.9; }

.centro { margin: auto 0 12cqw; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4cqw; text-shadow: 0 0.3cqw 3cqw rgba(0, 0, 0, 0.7); }
.pulso { width: 9cqw; height: 9cqw; border-radius: 50%; border: 0.7cqw solid rgba(255, 255, 255, 0.25); border-top-color: var(--destaque); animation: girar 0.9s linear infinite; }
@keyframes girar { to { transform: rotate(1turn); } }

.rec { align-self: flex-start; display: flex; align-items: center; gap: 1.6cqw; background: rgba(0, 0, 0, 0.45); border-radius: 99cqw; padding: 1.4cqw 3cqw; font-size: 2.6cqw; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }
.rec i { width: 2.2cqw; height: 2.2cqw; border-radius: 50%; background: #ff3b30; animation: piscar 1s steps(2) infinite; }
@keyframes piscar { 50% { opacity: 0.2; } }

.fim { margin: auto 0; text-align: center; align-items: center; }
.qr { width: 52cqw; aspect-ratio: 1; background: #fff; border-radius: 4cqw; padding: 2.5cqw; }
.qr svg { width: 100%; height: 100%; display: block; }
.fim .principal { align-self: stretch; }
.teste { position: absolute; top: 1.5cqw; right: 2cqw; font-size: 2cqw; background: #ff3b30; color: #fff; padding: 0.6cqw 1.6cqw; border-radius: 99cqw; font-weight: 700; z-index: 2; }
