/* Rifa do Abutrão: noite azul da Atlética, bilhete de papel picotado */
:root {
  --royal: #17368f;
  --noite: #0a1a45;
  --fundo: #081536;
  --ceu: #3b6cf0;
  --brilho: #6fb6ff;
  --gelo: #dcebff;
  --papel: #eef0f5;
  --prata: #a9b3c9;
  --tinta: #0d1a3d;
  --linha: rgba(255, 255, 255, .12);
  --erro: #ff8a8a;
  --disp: 'Teko', 'Arial Narrow', sans-serif;
  --corpo: 'Archivo', system-ui, sans-serif;
  --mola: cubic-bezier(.2, .9, .25, 1.15);
  --saida: cubic-bezier(.16, 1, .3, 1);
}
* { box-sizing: border-box; margin: 0 }
html { -webkit-text-size-adjust: 100%; background: var(--fundo) }
body {
  min-height: 100dvh; background: var(--fundo); color: #fff; font: 400 1rem/1.5 var(--corpo);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
  background-image: radial-gradient(120% 60% at 50% -10%, rgba(59, 108, 240, .35), transparent 60%);
  background-repeat: no-repeat;
}
img { max-width: 100%; display: block }
a { color: inherit }
button, input, select, textarea { font: inherit; color: inherit }
:focus-visible { outline: 3px solid var(--brilho); outline-offset: 2px; border-radius: 6px }
.hide { display: none !important }
.muted { color: var(--prata) }
.disp { font-family: var(--disp); font-weight: 600; line-height: .9; letter-spacing: .01em }
.app { width: min(520px, 100%); margin: 0 auto; padding: 0 16px 120px; position: relative }

/* marca d'água da garra */
.garra-fundo { position: fixed; right: -60px; top: 90px; width: 260px; opacity: .05; pointer-events: none; z-index: 0 }
.app > * { position: relative; z-index: 1 }

/* ---------- topo ---------- */
.topo { display: flex; align-items: center; gap: 10px; padding: 14px 0 6px }
.topo img { width: 40px; height: 40px; object-fit: contain }
.topo .t { line-height: 1.05 }
.topo .t b { display: block; font-family: var(--disp); font-weight: 600; font-size: 1.45rem; letter-spacing: .02em }
.topo .t small { color: var(--prata); font-size: .78rem }
.topo .acao { margin-left: auto }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer;
  text-decoration: none; font-weight: 700; padding: 14px 20px; border-radius: 12px; line-height: 1.2;
  transition: transform .15s, background .15s, box-shadow .15s; -webkit-tap-highlight-color: transparent;
}
.btn.principal { background: #fff; color: var(--royal); box-shadow: 0 5px 0 #9fb7e6 }
.btn.principal:active { transform: translateY(4px); box-shadow: 0 1px 0 #9fb7e6 }
.btn.azul { background: var(--ceu); color: #fff; box-shadow: 0 5px 0 #1e3f9e }
.btn.azul:active { transform: translateY(4px); box-shadow: 0 1px 0 #1e3f9e }
.btn.vazio { background: transparent; border: 1.5px solid rgba(255, 255, 255, .3); color: #fff }
.btn.peq { padding: 9px 13px; font-size: .9rem; border-radius: 10px }
.btn.cheio { width: 100% }
.btn.grande { font-size: 1.15rem; padding: 18px 20px }
.btn:disabled { opacity: .5; cursor: default; transform: none }
.btn svg { width: 20px; height: 20px; flex: none }

/* ---------- campos ---------- */
label.campo { display: block; margin-top: 14px }
label.campo > span { display: block; font-size: .85rem; color: var(--gelo); margin-bottom: 6px; font-weight: 600 }
label.campo > span i { font-style: normal; color: var(--prata); font-weight: 400 }
.inp {
  width: 100%; padding: 14px; border-radius: 12px; border: 1.5px solid var(--linha); background: rgba(255, 255, 255, .06);
  font-size: 1rem; outline: none; transition: border-color .15s, background .15s;
}
.inp:focus { border-color: var(--brilho); background: rgba(255, 255, 255, .09) }
.inp::placeholder { color: #7f8bab }
select.inp { appearance: none }
.erro-msg { color: var(--erro); font-size: .9rem; margin-top: 10px; min-height: 1.2em }

/* seletor segmentado */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; background: rgba(255, 255, 255, .06); padding: 5px; border-radius: 14px }
.seg button { border: 0; background: none; padding: 11px 6px; border-radius: 10px; font-weight: 600; color: var(--prata); cursor: pointer; transition: background .2s, color .2s }
.seg button[aria-pressed=true] { background: #fff; color: var(--royal) }

/* ---------- cartões ---------- */
.card { background: rgba(255, 255, 255, .05); border: 1px solid var(--linha); border-radius: 18px; padding: 18px }
.card + .card { margin-top: 12px }
h2.sec { font-family: var(--disp); font-weight: 600; font-size: 1.9rem; line-height: 1; margin: 28px 0 12px; letter-spacing: .01em }

/* ---------- herói da rifa ---------- */
.heroi { text-align: center; padding: 18px 0 8px }
.heroi .escudo { width: 150px; height: 150px; margin: 0 auto; object-fit: contain; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .45)); animation: pousa .9s var(--mola) both }
.heroi h1 { font-family: var(--disp); font-weight: 700; font-size: clamp(3rem, 15vw, 4.4rem); line-height: .85; margin-top: 14px; letter-spacing: .01em }
.heroi .premio { margin-top: 10px; font-size: 1.05rem; color: var(--gelo) }
.heroi .premio b { color: #fff }
.heroi .meta { margin-top: 6px; color: var(--prata); font-size: .92rem }
@keyframes pousa { from { opacity: 0; transform: translateY(-24px) scale(.9) } }

/* barra de números vendidos */
.barra { margin: 22px 0 4px }
.barra .trilho { height: 12px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden }
.barra .enche { height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--ceu), var(--brilho)); transition: width 1.4s var(--saida) }
.barra .leg { display: flex; justify-content: space-between; margin-top: 8px; font-size: .88rem; color: var(--prata) }
.barra .leg b { color: #fff; font-family: var(--disp); font-size: 1.35rem; font-weight: 600; line-height: 1 }

/* ---------- ranking ---------- */
.podio { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 8px; margin-top: 8px }
.podio .deg { text-align: center; min-width: 0 }
.podio .deg .nome { font-weight: 700; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.podio .deg .turma { font-size: .78rem; color: var(--prata); min-height: 1.2em }
.podio .bloco {
  margin-top: 8px; border-radius: 14px 14px 4px 4px; padding: 10px 4px 12px;
  background: linear-gradient(180deg, rgba(111, 182, 255, .28), rgba(111, 182, 255, .06)); border: 1px solid rgba(111, 182, 255, .3);
  transform-origin: bottom; animation: sobe .8s var(--mola) both;
}
.podio .deg:nth-child(2) .bloco { min-height: 132px; animation-delay: .1s; background: linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(220, 235, 255, .55)); color: var(--royal); border-color: #fff }
.podio .deg:nth-child(1) .bloco { min-height: 100px; animation-delay: .25s }
.podio .deg:nth-child(3) .bloco { min-height: 80px; animation-delay: .4s }
.podio .pos { font-family: var(--disp); font-weight: 700; font-size: 2.6rem; line-height: .8 }
.podio .qtd { font-size: .8rem; font-weight: 600; opacity: .85 }
.podio .vazio-deg .bloco { opacity: .35 }
@keyframes sobe { from { transform: scaleY(.2); opacity: 0 } }

.lista-rk { list-style: none; padding: 0; margin-top: 14px }
.lista-rk li { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding: 12px 4px; border-bottom: 1px solid var(--linha) }
.lista-rk li .p { font-family: var(--disp); font-size: 1.5rem; font-weight: 600; color: var(--prata); text-align: center; line-height: 1 }
.lista-rk li .n { min-width: 0 }
.lista-rk li .n b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.lista-rk li .n small { color: var(--prata) }
.lista-rk li .q { font-family: var(--disp); font-size: 1.5rem; font-weight: 600; line-height: 1 }
.lista-rk li .q small { font-family: var(--corpo); font-size: .72rem; color: var(--prata); font-weight: 400; margin-left: 3px }
.lista-rk li.eu { background: rgba(111, 182, 255, .12); border-radius: 12px; border-bottom-color: transparent }
.vazio { text-align: center; color: var(--prata); padding: 26px 10px }

/* lista pública de vendedores (toque abre o WhatsApp) */
.lista-vend { list-style: none; padding: 0; margin-top: 12px; display: grid; gap: 8px }
.lista-vend a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; border-radius: 14px; background: rgba(255, 255, 255, .05); border: 1px solid var(--linha); text-decoration: none; transition: background .15s, transform .12s }
.lista-vend a:active { transform: scale(.98); background: rgba(111, 182, 255, .14) }
.lista-vend span { min-width: 0 }
.lista-vend b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.lista-vend small { color: var(--prata); font-size: .82rem }
.lista-vend svg { width: 26px; height: 26px; flex: none; color: var(--brilho) }

/* anexo do comprovante */
.anexo { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px; border: 1.5px dashed rgba(255, 255, 255, .25); border-radius: 12px; cursor: pointer; transition: border-color .15s, background .15s }
.anexo:hover, .anexo:focus-within { border-color: var(--brilho); background: rgba(255, 255, 255, .04) }
.anexo input { position: absolute; width: 1px; height: 1px; opacity: 0 }
.anexo svg { width: 24px; height: 24px; flex: none; color: var(--brilho) }
.anexo span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--gelo) }
.anexo.tem { border-style: solid; border-color: var(--brilho) }

/* ---------- vendedor ---------- */
.ola { padding: 8px 0 4px }
.ola h1 { font-family: var(--disp); font-weight: 600; font-size: 2.4rem; line-height: .95 }
.resumo-v { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px }
.resumo-v .card { padding: 14px }
.resumo-v .card + .card { margin-top: 0 }
.resumo-v b { display: block; font-family: var(--disp); font-size: 2.1rem; font-weight: 600; line-height: .95 }
.resumo-v span { font-size: .82rem; color: var(--prata) }

.qtd-box { text-align: center; padding: 22px 18px }
.qtd-box > span { font-size: .85rem; color: var(--gelo); font-weight: 600 }
.stepper { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 8px 0 4px }
.stepper button {
  width: 58px; height: 58px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .06);
  font-size: 1.9rem; line-height: 1; cursor: pointer; transition: transform .12s, background .15s; -webkit-tap-highlight-color: transparent;
}
.stepper button:active { transform: scale(.9); background: rgba(255, 255, 255, .14) }
.stepper output { font-family: var(--disp); font-size: 5rem; font-weight: 600; line-height: .85; min-width: 110px; padding-top: 8px }
.stepper output.pulo { animation: pulo .25s var(--mola) }
@keyframes pulo { 50% { transform: scale(1.12) } }
.atalhos { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 6px }
.atalhos button { border: 1px solid var(--linha); background: none; min-width: 48px; min-height: 44px; padding: 7px 14px; border-radius: 99px; font-weight: 600; font-size: .9rem; cursor: pointer; color: var(--gelo) }
.atalhos button:active { background: rgba(255, 255, 255, .1) }
.total { margin-top: 14px; font-size: .95rem; color: var(--prata) }
.total b { color: #fff; font-family: var(--disp); font-size: 1.9rem; font-weight: 600; margin-left: 6px; vertical-align: -3px }

/* ---------- bilhete ---------- */
.bilhete {
  --furo: 14px;
  position: relative; color: var(--tinta); border-radius: 18px; overflow: hidden;
  background-color: var(--papel);
  background-image: radial-gradient(rgba(13, 26, 61, .05) 1px, transparent 1.2px), radial-gradient(rgba(13, 26, 61, .035) 1px, transparent 1.2px);
  background-size: 7px 7px, 11px 11px; background-position: 0 0, 3px 5px;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .6);
  animation: imprime .7s var(--saida) both;
}
@keyframes imprime { from { clip-path: inset(0 0 100% 0); transform: translateY(-14px) } to { clip-path: inset(0 0 0 0) } }
.bilhete .cab { display: flex; align-items: center; gap: 12px; background: var(--royal); color: #fff; padding: 14px 16px }
.bilhete .cab img { width: 44px; height: 44px; object-fit: contain }
.bilhete .cab b { display: block; font-family: var(--disp); font-size: 1.6rem; font-weight: 600; line-height: .95 }
.bilhete .cab small { font-size: .78rem; opacity: .8 }
.bilhete .corpo { padding: 16px 16px 6px }
.bilhete .quem { font-size: .88rem; color: #46557d }
.bilhete .quem b { color: var(--tinta) }
.nums { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px }
.nums span {
  font-family: var(--disp); font-weight: 600; font-size: 1.85rem; line-height: 1; letter-spacing: .04em;
  padding: 8px 10px 4px; border: 2px solid var(--royal); border-radius: 8px; color: var(--royal); background: #fff;
  animation: cai .5s var(--mola) both; animation-delay: calc(var(--i, 0) * 60ms + .35s);
}
@keyframes cai { from { opacity: 0; transform: translateY(-10px) rotate(-6deg) } }
.nums.todos { gap: 6px; margin-top: 8px }
.nums.todos span { font-size: 1.25rem; padding: 5px 7px 2px; border-width: 1.5px; animation: none }
.nums.todos span.novo { background: var(--royal); color: #fff }

/* sugestões de comprador (autocompletar) */
.sugestoes { display: grid; gap: 6px; margin-top: 8px }
.sugestoes:empty { display: none }
.sugestoes button { display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; padding: 11px 14px; border-radius: 12px; border: 1px solid rgba(111, 182, 255, .35); background: rgba(111, 182, 255, .1); cursor: pointer; min-height: 48px }
.sugestoes button:active { background: rgba(111, 182, 255, .2) }
.sugestoes b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.sugestoes small { color: var(--prata); font-size: .82rem }
.sugestoes .qt { flex: none; font-size: .8rem; color: var(--gelo); font-weight: 600 }
.dica-comprador { margin-top: 8px; font-size: .88rem; color: var(--brilho) }

/* picote */
.bilhete .picote { position: relative; height: var(--furo); margin: 10px 0 0 }
.bilhete .picote::before { content: ''; position: absolute; left: 18px; right: 18px; top: 50%; border-top: 2px dashed rgba(13, 26, 61, .25) }
.bilhete .picote::after, .bilhete .picote i {
  content: ''; position: absolute; top: 0; width: var(--furo); height: var(--furo); border-radius: 50%; background: var(--fundo); left: calc(var(--furo) / -2)
}
.bilhete .picote i { left: auto; right: calc(var(--furo) / -2) }
.bilhete .rodape { display: flex; justify-content: space-between; align-items: center; padding: 8px 16px 14px; font-size: .8rem; color: #46557d }
.bilhete .rodape b { font-family: var(--disp); font-size: 1.3rem; color: var(--tinta); letter-spacing: .06em; font-weight: 600 }

.acoes { display: grid; gap: 10px; margin-top: 18px }
.acoes .dupla { display: grid; grid-template-columns: 1fr 1fr; gap: 10px }

/* ---------- minhas vendas ---------- */
.venda { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 14px 0; border-bottom: 1px solid var(--linha) }
.venda .t b { display: block }
.venda .t small { color: var(--prata) }
.venda .v { text-align: right; font-weight: 700 }
.venda .v small { display: block; color: var(--prata); font-weight: 400; font-size: .8rem }
.venda .ns { grid-column: 1 / -1; font-family: var(--disp); font-size: 1.25rem; letter-spacing: .05em; color: var(--gelo); line-height: 1.1 }
.venda .bts { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px }
.venda.cancelada { opacity: .45 }
.venda.cancelada .ns { text-decoration: line-through }
.tag { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 2px 8px; border-radius: 6px; background: rgba(255, 255, 255, .1); color: var(--gelo); vertical-align: 2px }

/* ---------- barra de baixo ---------- */
.nav-baixo {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: center;
  background: rgba(8, 21, 54, .92); backdrop-filter: blur(14px); border-top: 1px solid var(--linha);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
}
.nav-baixo .in { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; width: min(520px, 100%) }
.nav-baixo button { background: none; border: 0; display: grid; justify-items: center; gap: 2px; padding: 6px; font-size: .75rem; font-weight: 600; color: var(--prata); cursor: pointer }
.nav-baixo button svg { width: 24px; height: 24px }
.nav-baixo button[aria-current=page] { color: #fff }
.nav-baixo button[aria-current=page] svg { color: var(--brilho) }

/* aviso que aparece embaixo */
.toast {
  position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 60; transform: translate(-50%, 20px); opacity: 0;
  background: #fff; color: var(--tinta); padding: 12px 18px; border-radius: 12px; font-weight: 600; box-shadow: 0 12px 30px rgba(0, 0, 0, .4);
  transition: transform .3s var(--saida), opacity .3s; max-width: calc(100% - 32px); text-align: center; pointer-events: none
}
.toast.on { transform: translate(-50%, 0); opacity: 1 }

/* folha de baixo (modal) */
.folha-fundo { position: fixed; inset: 0; z-index: 50; background: rgba(3, 9, 26, .7); display: flex; align-items: flex-end; justify-content: center; animation: aparece .2s both }
.folha { width: min(520px, 100%); max-height: 92dvh; overflow: auto; background: var(--noite); border-radius: 22px 22px 0 0; padding: 20px 18px calc(22px + env(safe-area-inset-bottom)); border-top: 1px solid var(--linha); animation: sobeFolha .35s var(--saida) both }
.folha h3 { font-family: var(--disp); font-size: 1.9rem; font-weight: 600; line-height: 1 }
@keyframes aparece { from { opacity: 0 } }
@keyframes sobeFolha { from { transform: translateY(40px); opacity: 0 } }

/* carregando */
.carregando { display: grid; place-items: center; min-height: 50dvh }
.carregando img { width: 70px; animation: respira 1.2s ease-in-out infinite }
@keyframes respira { 50% { transform: scale(.9); opacity: .6 } }

/* rodapé da Vetor */
.vetor { margin: 40px 0 0; padding: 18px 0 0; border-top: 1px solid var(--linha); text-align: center; font-size: .82rem; color: var(--prata) }
.vetor a { color: var(--gelo); text-decoration: none; font-weight: 600 }
.vetor img { height: 18px; display: inline-block; vertical-align: -4px; margin-right: 4px }
.vetor p + p { margin-top: 4px }

/* ---------- admin ---------- */
.tabela-v { list-style: none; padding: 0 }
.tabela-v li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--linha) }
.tabela-v li .q { font-family: var(--disp); font-size: 1.6rem; font-weight: 600; line-height: 1; text-align: right }
.tabela-v li .q small { display: block; font-family: var(--corpo); font-size: .78rem; color: var(--prata); font-weight: 400 }
.tabela-v li .bts { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px }
.tabela-v li.off { opacity: .5 }
.chave { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0 }
.chave input { width: 48px; height: 28px; appearance: none; background: rgba(255, 255, 255, .15); border-radius: 99px; position: relative; cursor: pointer; transition: background .2s; flex: none }
.chave input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s var(--mola) }
.chave input:checked { background: var(--ceu) }
.chave input:checked::after { transform: translateX(20px) }
.grade2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 10px }
.grade2 .inp { min-width: 0 }

@media (prefers-reduced-motion: reduce) {
  .barra .enche { transition-duration: .01s }
}
