/* Estilo das páginas das festas com tema (Fase 4). As cores e fontes vêm do tema da festa
   (temas.js), aplicadas como variáveis pelo tema-base.js. */
:root {
  --p-bg: #FFF6EA; --p-surface: #FFFFFF; --p-ink: #2A1A12; --p-muted: #6A5547; --p-accent: #C93A22; --p-on: #FFFFFF;
  --p-soft: #FFE3D6; --p-line: #F0DCCB; --p-hero: #FFE1D2; --p-tv: #2A1A12; --p-tvink: #FFF6EA; --p-tvaccent: #FFB84D; --p-tvon: #2A1A12;
  --p-t1: #FFD3C2; --p-t2: #BDEBE4; --p-t3: #FFE6A6; --p-t4: #D9D0FF; --p-tink: #2A1A12;
  --p-font: 'Fredoka', sans-serif; --p-peso: 600; --p-r: 24px; --p-rb: 999px;
  --f-ui: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ok-bg: #CDEFD9; --ok-fg: #0E4B27; --agu-bg: #FFE7B0; --agu-fg: #5A3D00; --rec-bg: #FFD5D2; --rec-fg: #7A1710;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--p-bg); color: var(--p-ink); font-family: var(--f-ui); font-size: 16px; -webkit-tap-highlight-color: transparent; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--p-accent); outline-offset: 2px; }
[hidden] { display: none !important; }

.app { max-width: 560px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; }
.cab { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: max(14px, env(safe-area-inset-top)) 18px 8px; }
.logo { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--p-muted); min-width: 0; }
.logo i { width: 26px; height: 26px; border-radius: 8px; background: var(--p-accent); color: var(--p-on); display: grid; place-items: center; font-style: normal; font-size: 13px; flex-shrink: 0; }
.logo span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eu { display: flex; align-items: center; gap: 6px; padding: 3px 12px 3px 3px; border-radius: 999px; background: var(--p-surface); border: 1px solid var(--p-line); font-size: 13px; font-weight: 700; max-width: 50%; }
.eu b { width: 26px; height: 26px; border-radius: 50%; background: var(--p-t2); color: var(--p-tink); display: grid; place-items: center; font-size: 12px; flex-shrink: 0; }
.eu span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rola { flex: 1; padding: 6px 16px 110px; display: flex; flex-direction: column; gap: 14px; }
.tela { display: none; flex-direction: column; gap: 14px; }
.tela.ativa { display: flex; animation: entra .3s ease both; }
@keyframes entra { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .tela.ativa, .pulsa, .gira, .aviso { animation: none !important; } }

.disp { font-family: var(--p-font); font-weight: var(--p-peso); line-height: 1.05; margin: 0; text-wrap: balance; }
.titulo { font-size: 30px; }
.mut { color: var(--p-muted); }
.pequeno { font-size: 13px; }
.cabecalho-tela { display: flex; flex-direction: column; gap: 4px; }
.card { background: var(--p-surface); border: 1px solid var(--p-line); border-radius: var(--p-r); }
.btn { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 56px; border: 0; border-radius: var(--p-rb); background: var(--p-accent); color: var(--p-on); font-weight: 700; font-size: 17px; width: 100%; padding: 0 18px; text-decoration: none; transition: transform .12s; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: default; }
.btn2 { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 52px; border: 1.5px solid var(--p-line); border-radius: var(--p-rb); background: transparent; color: var(--p-ink); font-weight: 700; font-size: 16px; width: 100%; padding: 0 16px; text-decoration: none; }
.btn svg, .btn2 svg { width: 21px; height: 21px; flex-shrink: 0; }
.dupla { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }

.hero { position: relative; border-radius: var(--p-r); background: var(--p-hero); padding: 18px; min-height: 196px; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; overflow: hidden; }
.hero .m { position: absolute; }
.hero > *:not(.m) { position: relative; }
.hero h1 { font-size: 38px; max-width: 72%; }
.vivo { position: absolute !important; top: 16px; left: 18px; display: inline-flex; align-items: center; gap: 6px; background: var(--p-accent); color: var(--p-on); border-radius: 999px; padding: 5px 11px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.vivo::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pulsa { animation: pulsa 1.6s ease-in-out infinite; }
@keyframes pulsa { 50% { opacity: .55; } }

.barra-p { display: block; height: 10px; border-radius: 999px; background: var(--p-soft); overflow: hidden; }
.barra-p span { display: block; height: 100%; border-radius: 999px; background: var(--p-accent); transition: width .45s; }
.grade4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.grade3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.miniatura { aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--p-soft); border: 0; padding: 0; position: relative; width: 100%; display: block; }
.miniatura img { width: 100%; height: 100%; object-fit: cover; display: block; }
.miniatura .leg { position: absolute; left: 6px; bottom: 6px; right: 6px; font-size: 11px; font-weight: 700; color: #1d1a22; background: rgba(255,255,255,.82); border-radius: 6px; padding: 2px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.vazio { text-align: center; padding: 22px 12px; color: var(--p-muted); font-size: 14px; }

.camera { position: relative; border-radius: 24px; overflow: hidden; background: #17141B; color: #fff; aspect-ratio: 3 / 4; width: 100%; }
.camera video, .camera img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.camera video.espelho { transform: scaleX(-1); }
.camera .erro-cam { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px; padding: 24px; font-size: 15px; line-height: 1.45; }
.moldura { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--p-accent); color: var(--p-on); }
.moldura .disp { font-size: 22px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.moldura small { font-size: 11px; font-weight: 700; opacity: .85; white-space: nowrap; }
.moldura-png { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.flash.vai { animation: flash .35s ease-out; }
@keyframes flash { from { opacity: .9; } to { opacity: 0; } }
.ctrl { display: flex; align-items: center; justify-content: space-around; }
.redondo { width: 54px; height: 54px; border-radius: 50%; border: 1.5px solid var(--p-line); background: var(--p-surface); display: grid; place-items: center; }
.redondo svg { width: 23px; height: 23px; }
.disparo { width: 80px; height: 80px; border-radius: 50%; padding: 6px; border: 4px solid var(--p-accent); background: transparent; }
.disparo span { display: block; width: 100%; height: 100%; border-radius: 50%; background: var(--p-accent); }
.disparo:disabled { opacity: .4; }

.selo { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 800; border-radius: 999px; padding: 3px 10px; white-space: nowrap; align-self: flex-start; }
.s-pend { background: var(--p-soft); color: var(--p-ink); }
.s-agu { background: var(--agu-bg); color: var(--agu-fg); }
.s-ok { background: var(--ok-bg); color: var(--ok-fg); }
.s-rec { background: var(--rec-bg); color: var(--rec-fg); }
.linha { display: flex; align-items: center; gap: 12px; padding: 13px; text-align: left; width: 100%; }
.linha .n { width: 42px; height: 42px; border-radius: 12px; background: var(--p-soft); color: var(--p-ink); display: grid; place-items: center; font-weight: 800; flex-shrink: 0; }
.linha .n.ok { background: var(--p-accent); color: var(--p-on); }
.linha .n svg { width: 21px; height: 21px; }
.linha .txt { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.linha strong { font-size: 15px; }
.linha .desc { font-size: 13px; color: var(--p-muted); line-height: 1.35; }
.linha > svg { width: 20px; height: 20px; opacity: .5; flex-shrink: 0; }
.voltar { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; font-weight: 700; font-size: 15px; color: var(--p-muted); padding: 0; min-height: 44px; align-self: flex-start; }
.voltar svg { width: 19px; height: 19px; }

.campo { display: flex; flex-direction: column; gap: 6px; }
.campo label { font-size: 15px; font-weight: 700; }
.campo input, .campo textarea { border: 1.5px solid var(--p-line); background: var(--p-surface); color: var(--p-ink); border-radius: 14px; padding: 14px; font-size: 17px; resize: none; width: 100%; }
.contador { font-size: 12px; color: var(--p-muted); text-align: right; }
.recado { display: flex; gap: 10px; padding: 13px; }
.recado b { width: 36px; height: 36px; border-radius: 50%; background: var(--p-t2); color: var(--p-tink); display: grid; place-items: center; flex-shrink: 0; font-size: 14px; }
.recado div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.recado span { line-height: 1.45; overflow-wrap: anywhere; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; background: var(--p-surface); border-top: 1px solid var(--p-line); padding: 6px max(8px, env(safe-area-inset-left)) max(12px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-right)); z-index: 4; }
.tabbar > div { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; max-width: 560px; }
.tabbar button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; color: var(--p-muted); min-height: 54px; justify-content: center; }
.tabbar button[aria-current="page"] { color: var(--p-accent); font-weight: 800; }
.tabbar svg { width: 24px; height: 24px; }

.aviso { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(92px + env(safe-area-inset-bottom)); width: min(520px, calc(100% - 28px)); background: var(--p-ink); color: var(--p-bg); border-radius: 14px; padding: 13px 15px; font-size: 15px; font-weight: 600; display: flex; gap: 9px; align-items: center; animation: entra .25s ease both; z-index: 9; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.aviso.erro { background: #B42318; color: #fff; }
.aviso svg { width: 19px; height: 19px; flex-shrink: 0; }
.gira { animation: gira 1s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }
.dica { font-size: 13px; text-align: center; color: var(--p-muted); background: var(--p-soft); border-radius: 12px; padding: 10px; line-height: 1.4; }

.comprovante { border-radius: var(--p-r); background: var(--p-accent); color: var(--p-on); padding: 26px 20px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.comprovante .cod { font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace; font-size: 26px; letter-spacing: .12em; background: rgba(255,255,255,.18); border-radius: 10px; padding: 6px 14px; }
.comprovante .ico { width: 66px; height: 66px; border-radius: 50%; background: var(--p-on); color: var(--p-accent); display: grid; place-items: center; }
.comprovante .ico svg { width: 34px; height: 34px; }

.abas { display: flex; gap: 6px; background: var(--p-soft); padding: 4px; border-radius: 14px; }
.abas button { flex: 1; border: 0; background: none; border-radius: 10px; padding: 9px 4px; font-weight: 700; font-size: 14px; min-height: 44px; color: var(--p-ink); }
.abas button[aria-selected="true"] { background: var(--p-surface); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

.janela { position: fixed; inset: 0; background: rgba(10,8,14,.94); z-index: 10; display: flex; flex-direction: column; padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); gap: 12px; color: #fff; }
.janela .foto-grande { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.janela .foto-grande img { max-width: 100%; max-height: 100%; border-radius: 12px; object-fit: contain; }
.janela p { margin: 0; text-align: center; line-height: 1.45; }
.janela .ctrl { gap: 8px; flex-wrap: wrap; }
.janela .ctrl button, .janela .ctrl a { min-height: 46px; border-radius: 999px; border: 1px solid rgba(255,255,255,.35); background: transparent; color: #fff; padding: 0 18px; font-weight: 700; display: inline-flex; align-items: center; text-decoration: none; }

.regras { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; line-height: 1.45; }
