* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #41454c; color: #fff; touch-action: none; user-select: none; -webkit-user-select: none;
  font-family: "Baloo 2", "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif; }
#tela { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
button, a { font: inherit; cursor: pointer; border: 0; color: #fff; text-decoration: none; }
#flash { position: fixed; inset: 0; pointer-events: none; opacity: 0; z-index: 4; }
#flash.on { animation: flash .35s ease-out; }
@keyframes flash { 0% { opacity: .45; } 100% { opacity: 0; } }

/* HUD */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; display: none; }
#hud.ativo { display: block; }
.placar { position: absolute; top: max(10px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); text-align: center; line-height: .9; }
#pontos { font-size: clamp(56px, 12vw, 96px); font-weight: 900; -webkit-text-stroke: 3px #2b1a08; text-shadow: 0 5px 0 rgba(0,0,0,.3); }
#pontos.pula { animation: pula .18s; }
@keyframes pula { 50% { transform: scale(1.2); } }
.placar small { font-size: 16px; font-weight: 800; text-shadow: 0 2px 3px #000; }
#meta { font-size: 14px; font-weight: 800; color: #ffd23f; text-shadow: 0 2px 3px #000; margin-top: 4px; }
#relogio { position: absolute; top: max(12px, env(safe-area-inset-top)); right: 14px; width: 74px; height: 74px; display: grid; place-items: center; }
#anel { --p: 100; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(#ffd23f calc(var(--p) * 1%), rgba(0,0,0,.35) 0); -webkit-mask: radial-gradient(circle, transparent 54%, #000 56%); mask: radial-gradient(circle, transparent 54%, #000 56%); }
#tempo { font-size: 32px; font-weight: 900; -webkit-text-stroke: 1.5px #2b1a08; }
#relogio.urgente #anel { background: conic-gradient(#ff4a3a calc(var(--p) * 1%), rgba(0,0,0,.35) 0); }
#relogio.urgente #tempo { color: #ff6a4a; animation: pula .5s infinite; }
.pam { position: absolute; top: max(14px, env(safe-area-inset-top)); left: 14px; font-size: 26px; font-weight: 900; background: rgba(0,0,0,.35); border-radius: 16px; padding: 4px 12px; }
.pam.pula { animation: pula .25s; }
.botao { position: absolute; left: 14px; top: 64px; width: 44px; height: 44px; border-radius: 14px; background: rgba(0,0,0,.35); font-size: 20px; pointer-events: auto; }
#aviso { position: absolute; top: 30%; left: 50%; transform: translate(-50%, 0); font-size: clamp(26px, 5vw, 44px); font-weight: 900; color: #fff; -webkit-text-stroke: 2px #2b1a08;
  white-space: nowrap; opacity: 0; text-shadow: 0 4px 0 rgba(0,0,0,.3); }
#aviso.mostra { animation: aviso 1.8s ease-out forwards; }
@keyframes aviso { 0% { opacity: 0; transform: translate(-50%, 20px) scale(.7); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1.05); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -20px); } }
#contagem { position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%); font-size: 130px; font-weight: 900; color: #ffd23f; -webkit-text-stroke: 4px #2b1a08; opacity: 0; }
#contagem.mostra { animation: cont .75s ease-out forwards; }
#contagem.vai { font-size: clamp(54px, 11vw, 110px); color: #7dff6a; animation-duration: 1.1s; }
@keyframes cont { 0% { opacity: 0; transform: translate(-50%, -50%) scale(2); } 25% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(.9); } }
.dicaDedo { position: absolute; bottom: max(14px, env(safe-area-inset-bottom)); left: 0; right: 0; text-align: center; font-size: 14px; font-weight: 700; opacity: .8; text-shadow: 0 1px 3px #000; }

/* telas */
.tela { position: fixed; inset: 0; z-index: 10; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 20px; text-align: center; overflow-y: auto; touch-action: pan-y; }
.tela.ativa { display: flex; animation: aparece .3s ease-out; }
@keyframes aparece { from { opacity: 0; } }
#menu { background: linear-gradient(rgba(20,25,35,.25), rgba(20,25,35,.65)), url(../assets/arte/titulo.jpg) center/cover; }
.logo { line-height: .82; filter: drop-shadow(0 6px 0 rgba(0,0,0,.35)); animation: bob 2.2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-1deg); } }
.logo .l1 { font-size: clamp(30px, 7vw, 64px); font-weight: 900; color: #ffd23f; -webkit-text-stroke: 2.5px #3a1a05; }
.logo .l2 { font-size: clamp(46px, 11vw, 108px); font-weight: 900; color: #ff5a2a; -webkit-text-stroke: 3.5px #3a1a05; letter-spacing: 1px; }
#escolha { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.perso { width: 200px; background: rgba(0,0,0,.45); border: 3px solid rgba(255,255,255,.25); border-radius: 20px; padding: 10px; display: flex; flex-direction: column; align-items: center; gap: 2px; transition: transform .15s; }
.perso .pix { height: 70px; width: auto; image-rendering: pixelated; }
.perso b { font-size: 22px; } .perso span { font-size: 12px; opacity: .85; line-height: 1.1; }
.perso.sel { border-color: #ffd23f; background: rgba(120,80,10,.7); transform: translateY(-4px) scale(1.04); box-shadow: 0 0 18px rgba(255,210,63,.6); }
.principal { font-size: 30px; font-weight: 900; padding: 12px 40px; border-radius: 20px; background: linear-gradient(#ffb53a, #f07d1a); box-shadow: 0 6px 0 #8a3c06, 0 10px 22px rgba(0,0,0,.35); text-shadow: 0 2px 0 rgba(0,0,0,.3); }
.principal:active { transform: translateY(4px); box-shadow: 0 2px 0 #8a3c06; }
.principal.verde { background: linear-gradient(#8ee34b, #3fae1c); box-shadow: 0 6px 0 #1d5e08, 0 10px 22px rgba(0,0,0,.35); font-size: 24px; padding: 10px 26px; }
#recMenu { font-size: 20px; font-weight: 800; text-shadow: 0 2px 3px #000; }
#desafio { background: #b03a2e; border-radius: 14px; padding: 8px 16px; font-size: 18px; font-weight: 800; box-shadow: 0 4px 0 #5a1a12; }
.ajuda { font-size: 14px; opacity: .9; text-shadow: 0 1px 3px #000; max-width: 520px; }
#resultado { background: rgba(10,12,20,.6); }
.caixa { background: linear-gradient(#5a6068, #34383e); border: 4px solid #ffd23f; border-radius: 26px; padding: 16px 22px; display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 94vw;
  box-shadow: 0 10px 0 #1e2125, 0 20px 50px rgba(0,0,0,.5); animation: caixa .45s cubic-bezier(.2,1.6,.4,1); }
@keyframes caixa { from { transform: scale(.5); opacity: 0; } }
.caixa h2 { font-size: 40px; font-weight: 900; color: #ffd23f; -webkit-text-stroke: 1.5px #3a1a05; }
#resultado.recorde h2 { animation: pula .6s infinite; color: #7dff6a; }
.numeros { display: flex; gap: 18px; }
.numeros div { display: flex; flex-direction: column; } .numeros b { font-size: 44px; line-height: 1; } .numeros small { font-size: 13px; opacity: .85; }
#resDesafio { font-size: 15px; font-weight: 700; color: #ffd8a0; }
#prev canvas { width: min(240px, 56vw, 32vh); height: auto; border-radius: 14px; box-shadow: 0 4px 14px rgba(0,0,0,.5); }
#opcoes { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
#opcoes a, #opcoes button { background: #2f7a12; padding: 6px 14px; border-radius: 12px; font-weight: 800; font-size: 15px; }
#opcoes a#bZap { background: #25d366; }
.linha { display: flex; gap: 10px; }
.linha button { background: rgba(255,255,255,.15); padding: 8px 20px; border-radius: 14px; font-weight: 800; font-size: 18px; }
#carregando { position: fixed; inset: 0; z-index: 20; background: #41454c; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; transition: opacity .5s; }
#carregando.some { opacity: 0; pointer-events: none; }
#barra { width: min(320px, 70vw); height: 16px; border-radius: 10px; background: rgba(0,0,0,.4); overflow: hidden; border: 2px solid rgba(255,255,255,.3); }
#barra i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffd23f, #ff5a2a); transition: width .2s; }
@media (max-height: 560px) { .perso { width: 160px; padding: 6px; } .perso .pix { height: 46px; } .principal { font-size: 22px; padding: 8px 26px; } .tela { gap: 8px; } #prev { display: none; } .logo .l2 { font-size: 54px; } }
