:root {
  --azul: #1d4ed8; --azul-escuro: #1e3a8a; --verde: #15803d; --vermelho: #b91c1c; --cinza: #475569;
  --fundo: #eef2ff; --texto: #0f172a; --branco: #ffffff;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--fundo); color: var(--texto);
  -webkit-tap-highlight-color: transparent; user-select: none;
}
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.tela { display: none; min-height: 100dvh; padding: 16px; flex-direction: column; align-items: center; justify-content: center; gap: 24px; }
.tela.ativa { display: flex; }
.ic { width: 32px; height: 32px; flex: none; }
.ic-grande { width: 120px; height: 120px; }
.ic-enorme { width: 160px; height: 160px; }
.ic-enorme.menor { width: 90px; height: 90px; margin-top: -16px; }
button { font: inherit; cursor: pointer; border: 0; }

.topo { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 700; color: var(--azul-escuro); min-height: 32px; }
.botao-bater {
  width: min(78vw, 320px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #3b82f6, var(--azul) 60%, var(--azul-escuro));
  color: var(--branco); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 14px 30px rgba(29, 78, 216, .45), inset 0 -8px 0 rgba(0, 0, 0, .15);
  animation: pulsar 2.4s ease-in-out infinite;
}
.botao-bater:active { transform: scale(.96); }
.botao-bater .rotulo { font-size: 26px; font-weight: 800; }
@keyframes pulsar { 50% { box-shadow: 0 14px 44px rgba(29, 78, 216, .7), inset 0 -8px 0 rgba(0, 0, 0, .15); } }
.botao-secundario {
  display: flex; align-items: center; gap: 12px; padding: 16px 28px; border-radius: 999px;
  background: var(--branco); color: var(--azul-escuro); font-size: 22px; font-weight: 700;
  box-shadow: 0 4px 12px rgba(15, 23, 42, .12);
}
.moldura { position: relative; width: min(80vw, 320px); aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: #000; }
.moldura video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.anel { position: absolute; inset: 0; border-radius: 50%; border: 10px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: girar 1s linear infinite; }
.girando { width: 120px; height: 120px; border-radius: 50%; border: 14px solid #c7d2fe; border-top-color: var(--azul); animation: girar .9s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }

.tela-cheia { color: var(--branco); text-align: center; }
.verde { background: var(--verde); }
.vermelho { background: var(--vermelho); }
.cinza { background: var(--cinza); }
.hora-grande { font-size: 84px; font-weight: 800; letter-spacing: 2px; line-height: 1; }
.comprovante { font-size: 22px; line-height: 1.5; font-weight: 600; }
.selo { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; padding: 6px 14px; border-radius: 999px; background: rgba(0, 0, 0, .25); font-size: 18px; }
.texto-erro { font-size: 30px; font-weight: 800; max-width: 340px; }
.linha-botoes { display: flex; gap: 28px; }
.botao-redondo { width: 76px; height: 76px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .22); color: var(--branco); }
.botao-redondo .ic { width: 40px; height: 40px; }
.botao-redondo.grande { width: 96px; height: 96px; background: var(--branco); color: var(--vermelho); }
.botao-redondo.grande .ic { width: 52px; height: 52px; }
.botao-redondo.azul { background: var(--azul); width: 64px; height: 64px; }

#tela-horas { justify-content: flex-start; gap: 18px; }
.barra { width: 100%; max-width: 480px; display: flex; align-items: center; justify-content: space-between; }
.titulo-mes { font-size: 24px; font-weight: 800; color: var(--azul-escuro); }
.cartoes { width: 100%; max-width: 480px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cartao { background: var(--branco); border-radius: 22px; padding: 16px 10px; display: flex; flex-direction: column; align-items: center; gap: 4px; box-shadow: 0 4px 12px rgba(15, 23, 42, .1); }
.cartao .ic { width: 44px; height: 44px; }
.cartao b { font-size: 40px; line-height: 1.1; }
.cartao small { font-size: 18px; color: var(--cinza); }
.c-dias .ic { color: #7c3aed; } .c-horas .ic { color: var(--azul); } .c-extras .ic { color: #ea580c; } .c-banco .ic { color: var(--verde); }
.sub { display: flex; align-items: center; gap: 8px; font-size: 20px; margin: 6px 0 0; color: var(--azul-escuro); width: 100%; max-width: 480px; }
.comprovantes { list-style: none; padding: 0; margin: 0; width: 100%; max-width: 480px; display: flex; flex-direction: column; gap: 10px; }
.comprovantes li { background: var(--branco); border-radius: 16px; padding: 10px 12px; display: flex; align-items: center; gap: 12px; }
.comprovantes li .hora { font-size: 28px; font-weight: 800; }
.comprovantes li .dados { flex: 1; font-size: 16px; color: var(--cinza); }
.comprovantes li button { width: 56px; height: 56px; border-radius: 50%; background: var(--azul); color: var(--branco); display: flex; align-items: center; justify-content: center; }

/* Tela sem cadastro com o teclado do código (A12). */
.com-teclado { gap: 14px; justify-content: flex-start; padding-top: 24px; }
.linha-icones { display: flex; align-items: center; gap: 18px; }
.ic-medio { width: 72px; height: 72px; }
.com-teclado .texto-erro { font-size: 26px; }
.codigo-digitos { display: flex; gap: 8px; }
.codigo-digitos span { width: 44px; height: 56px; border-radius: 12px; background: rgba(255, 255, 255, .92); color: var(--texto); font-size: 34px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.codigo-digitos.errado span { background: #fecaca; }
.teclado { display: grid; grid-template-columns: repeat(3, 84px); gap: 12px; }
.teclado button { height: 72px; border-radius: 20px; background: var(--branco); color: var(--texto); font-size: 34px; font-weight: 800; display: flex; align-items: center; justify-content: center; box-shadow: 0 3px 0 rgba(0, 0, 0, .25); }
.teclado button:active { transform: translateY(2px); box-shadow: none; }
