:root {
  --fundo: #F4F5F0;
  --texto: #14201B;
  --texto-2: #5B6660;
  --borda: #DDE1D8;
  --card: #FFFFFF;
  --marca: #0F3D2E;
  --acao: #C8F169;
  --pago-bg: #DCEFD9;
  --pago-tx: #1E5B2A;
  --pendente-bg: #FCE6CF;
  --pendente-tx: #8A4210;
  --atrasado-bg: #F9D4D0;
  --atrasado-tx: #8F1D14;
  --confirma: #1F8A4C;
  --raio: 16px;
  --f-texto: 'Barlow', system-ui, sans-serif;
  --f-num: 'Barlow Condensed', 'Barlow', system-ui, sans-serif;
  --f-logo: 'Luckiest Guy', 'Barlow Condensed', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fundo);
  color: var(--texto);
  font-family: var(--f-texto);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--marca); outline-offset: 2px; }

.pagina {
  max-width: 520px;
  margin: 0 auto;
  padding: 16px 16px calc(32px + env(safe-area-inset-bottom));
}

/* Topo */
.topo { text-align: center; padding: 8px 0 20px; }
.topo .logo { width: min(240px, 70%); height: auto; display: block; margin: 0 auto 10px; }
.topo .horario {
  margin: 0;
  font-family: var(--f-num);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--marca);
}
.topo .jogo { margin: 2px 0 0; color: var(--texto-2); }

/* Alternância */
.alternar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: var(--card);
  border: 1px solid var(--borda);
  border-radius: 999px;
  margin-bottom: 20px;
}
.alternar button {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-weight: 600;
  color: var(--texto-2);
}
.alternar button[aria-selected="true"] { background: var(--marca); color: #fff; }

/* Campos */
.campo { display: block; margin-bottom: 16px; }
.campo > span { display: block; font-weight: 600; margin-bottom: 6px; }
.campo input, .campo select {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--borda);
  border-radius: 12px;
  background: var(--card);
  font-size: 17px;
}
.campo select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--texto-2) 50%), linear-gradient(135deg, var(--texto-2) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
  padding-right: 36px;
}
.campo .ajuda { display: block; margin-top: 6px; font-size: 14px; color: var(--texto-2); }

/* Cards de item */
.itens { display: grid; gap: 10px; margin-bottom: 16px; }
.item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 72px;
  padding: 14px 16px;
  background: var(--card);
  border: 2px solid var(--borda);
  border-radius: var(--raio);
  text-align: left;
}
button.item { transition: border-color .15s, background .15s; }
button.item[aria-pressed="true"] { border-color: var(--marca); background: #F7FCEB; }
.item .marcador {
  flex: none;
  width: 24px;
  height: 24px;
  border: 2px solid var(--borda);
  border-radius: 7px;
  display: grid;
  place-items: center;
}
button.item[aria-pressed="true"] .marcador { background: var(--marca); border-color: var(--marca); }
button.item[aria-pressed="true"] .marcador::after {
  content: '';
  width: 6px;
  height: 11px;
  border: solid var(--acao);
  border-width: 0 3px 3px 0;
  transform: translateY(-1px) rotate(45deg);
}
.item .info { flex: 1; min-width: 0; }
.item .titulo { display: block; font-weight: 700; }
.item .sub { display: block; font-size: 14px; color: var(--texto-2); }
.item .valor { font-family: var(--f-num); font-weight: 700; font-size: 22px; white-space: nowrap; }
.item.pago { background: var(--pago-bg); border-color: var(--pago-bg); color: var(--pago-tx); }
.item.pago .sub { color: var(--pago-tx); }
.item.pago .marcador { border-color: var(--pago-tx); background: var(--pago-tx); }
.item.pago .marcador::after {
  content: '';
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 3px 3px 0;
  transform: translateY(-1px) rotate(45deg);
}

/* Chips de status */
.chip {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.chip.pago { background: var(--pago-bg); color: var(--pago-tx); }
.chip.pendente { background: var(--pendente-bg); color: var(--pendente-tx); }
.chip.atrasado { background: var(--atrasado-bg); color: var(--atrasado-tx); }

/* Botões */
.botao {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 56px;
  padding: 12px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--acao);
  color: var(--marca);
  font-family: var(--f-num);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  text-decoration: none;
}
.botao:disabled { opacity: .45; cursor: not-allowed; }
.botao.secundario { background: var(--card); border: 1px solid var(--borda); font-size: 18px; min-height: 48px; }
.botao.escuro { background: var(--marca); color: #fff; }
.botao-link {
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--marca);
  font-weight: 700;
  text-decoration: underline;
}
.nota { text-align: center; font-size: 14px; color: var(--texto-2); margin: 10px 0 0; }

/* Tudo pago */
.ta-pago {
  text-align: center;
  padding: 24px 16px;
  border-radius: var(--raio);
  background: var(--pago-bg);
  color: var(--pago-tx);
}
.ta-pago strong { display: block; font-family: var(--f-logo); font-size: 36px; font-weight: 400; line-height: 1.1; }
.ta-pago span { font-weight: 600; }

/* Estados */
.aviso {
  padding: 16px;
  border-radius: var(--raio);
  background: var(--card);
  border: 1px solid var(--borda);
  text-align: center;
  color: var(--texto-2);
}
.aviso.erro { background: var(--atrasado-bg); border-color: var(--atrasado-bg); color: var(--atrasado-tx); }
.carregando { min-height: 72px; border-radius: var(--raio); background: linear-gradient(90deg, #ECEEE8, #F8F9F5, #ECEEE8); background-size: 200% 100%; animation: brilho 1.2s infinite; }
@keyframes brilho { to { background-position: -200% 0; } }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--texto);
  color: #fff;
  font-weight: 600;
  z-index: 10;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Tela do Pix */
.voltar { min-height: 44px; padding: 0; border: 0; background: none; color: var(--marca); font-weight: 700; }
.pix { text-align: center; }
.pix-titulo { margin: 4px 0 0; font-family: var(--f-num); font-size: 22px; color: var(--texto-2); font-weight: 600; }
.pix-valor { margin: 0 0 12px; font-family: var(--f-num); font-weight: 700; font-size: 44px; color: var(--marca); line-height: 1.1; }
.pix-qr {
  display: block;
  width: min(240px, 70vw);
  height: auto;
  aspect-ratio: 1;
  margin: 0 auto 16px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--borda);
  border-radius: var(--raio);
}
.pix .campo { text-align: left; }
.pix-codigo {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--borda);
  border-radius: 12px;
  background: var(--card);
  font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--texto-2);
  resize: none;
  word-break: break-all;
}
.pix-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 0;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--pendente-bg);
  color: var(--pendente-tx);
  font-weight: 700;
}
.pix-status::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: currentColor; animation: pulso 1.2s ease-in-out infinite; }
.pix-status.expirado { background: var(--atrasado-bg); color: var(--atrasado-tx); }
.pix-status.expirado::before { animation: none; }
@keyframes pulso { 50% { opacity: .25; } }

.aviso.ok { background: var(--pago-bg); border-color: var(--pago-bg); color: var(--pago-tx); font-weight: 700; margin-bottom: 16px; }

/* Confirmação */
.confirmacao {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  background: var(--confirma);
  color: #fff;
  opacity: 1;
  transition: opacity .5s ease;
}
.confirmacao.saindo { opacity: 0; }
.confirmacao strong { font-family: var(--f-logo); font-weight: 400; font-size: 56px; letter-spacing: .02em; line-height: 1; animation: subir .4s .25s ease-out both; }
.confirmacao-check {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  animation: pop .45s cubic-bezier(.2, 1.6, .4, 1) both;
}
.confirmacao-check svg { width: 72px; height: 72px; }
.confirmacao-check path {
  fill: none;
  stroke: var(--confirma);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: tracar .35s .3s ease-out forwards;
}
@keyframes pop { 0% { transform: scale(0); } 100% { transform: scale(1); } }
@keyframes tracar { to { stroke-dashoffset: 0; } }
@keyframes subir { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .confirmacao-check path { stroke-dashoffset: 0; }
}

/* Avisos (push) */
.avisos {
  margin-top: 28px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--borda);
  border-radius: var(--raio);
}
.avisos h2 { margin: 0 0 6px; font-family: var(--f-num); font-size: 20px; color: var(--marca); }
.avisos p { margin: 0 0 12px; color: var(--texto-2); font-size: 15px; }
.avisos p:last-child { margin-bottom: 0; }
.avisos ol { margin: 0 0 4px; padding-left: 20px; color: var(--texto); font-size: 15px; }
.avisos ol li + li { margin-top: 6px; }
.avisos .ativo { color: var(--pago-tx); font-weight: 700; }
.avisos .botao { min-height: 48px; font-size: 18px; }
.icone-compartilhar { display: inline-block; width: 16px; height: 16px; vertical-align: -2px; }

/* Caixa de aviso (mensagem da notificação) */
.caixa-aviso {
  width: min(400px, calc(100% - 32px));
  padding: 24px 20px 20px;
  border: 0;
  border-radius: 20px;
  background: var(--card);
  color: var(--texto);
  box-shadow: 0 20px 50px rgba(15, 61, 46, .25);
}
.caixa-aviso::backdrop { background: rgba(20, 32, 27, .55); }
.caixa-aviso h2 { margin: 0 0 8px; font-family: var(--f-num); font-size: 26px; line-height: 1.15; color: var(--marca); }
.caixa-aviso-data { margin: 0 0 4px; font-size: 13px; font-weight: 600; color: var(--texto-2); text-transform: uppercase; letter-spacing: .04em; }
.caixa-aviso-corpo { margin: 0 0 20px; font-size: 17px; white-space: pre-line; }
.caixa-aviso form { margin: 0; }
.caixa-aviso[open] { animation: aparecer .2s ease-out; }
@keyframes aparecer { from { opacity: 0; transform: translateY(8px); } }

/* Goleiro não cobrado (falta) */
.item.ausente { background: transparent; border-style: dashed; color: var(--texto-2); }
.item.ausente .marcador { border-style: dashed; }
