:root {
  --verde: #1f4d3a;
  --verde-esc: #0f2a1f;
  --verde-claro: #2f6b52;
  --vermelho: #c0392b;
  --vermelho-esc: #9b2a1f;
  --dourado: #e0a83e;
  --dourado-claro: #f6d68b;
  --creme: #fbf7ef;
  --papel: #ffffff;
  --tinta: #1d2420;
  --muted: #6b746e;
  --linha: #ebe4d6;
  --res: #fdf0cf;
  --pago: #dfe9e2;
  --raio: 18px;
  --sombra: 0 1px 2px rgba(20, 30, 25, .05), 0 10px 30px -10px rgba(20, 30, 25, .12);
  --sombra-forte: 0 30px 60px -20px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--tinta);
  background: var(--creme);
  line-height: 1.5;
}
body.publico { background: radial-gradient(#e9e1cf 1px, transparent 1px) 0 0 / 22px 22px, var(--creme); }
body.com-barra { padding-bottom: 130px; }
h1, h2, .vencedor-num { font-family: Fraunces, Georgia, serif; line-height: 1.1; }
h2 { font-size: 1.35rem; margin: 0 0 .75rem; }
a { color: var(--verde); }
code { font-family: ui-monospace, Consolas, monospace; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.pequeno { font-size: .85rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .72rem; font-weight: 700; margin: 0 0 .4rem; opacity: .8; }
.linha { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.linha.fim { justify-content: flex-end; }

.titulo-secao { position: relative; padding-bottom: .5rem; margin-bottom: 1rem; }
.titulo-secao::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 44px; height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, var(--vermelho) 0 50%, var(--dourado) 50% 100%);
}

/* =================== HERO =================== */
.hero {
  position: relative; overflow: hidden; color: #fff;
  padding: 86px 0 130px;
  background:
    radial-gradient(ellipse 60% 70% at 85% 20%, rgba(224, 168, 62, .22), transparent 70%),
    radial-gradient(ellipse 50% 60% at 0% 100%, rgba(192, 57, 43, .18), transparent 70%),
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(165deg, #23593f 0%, var(--verde) 40%, var(--verde-esc) 100%);
}
.luzes { position: absolute; top: 0; left: 0; width: 100%; height: 70px; z-index: 1; }
.lampada { animation: piscar 2.4s ease-in-out infinite; }
.lampada ellipse { filter: drop-shadow(0 0 6px currentColor); }
@keyframes piscar { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.neve {
  position: absolute; inset: 0; pointer-events: none; opacity: .55;
  background-image:
    radial-gradient(2px 2px at 20px 30px, #fff, transparent),
    radial-gradient(1.5px 1.5px at 90px 120px, #fff, transparent),
    radial-gradient(2.5px 2.5px at 160px 60px, rgba(255,255,255,.9), transparent),
    radial-gradient(1.5px 1.5px at 230px 200px, #fff, transparent),
    radial-gradient(2px 2px at 280px 100px, rgba(255,255,255,.8), transparent),
    radial-gradient(1px 1px at 50px 250px, #fff, transparent),
    radial-gradient(2px 2px at 130px 280px, rgba(255,255,255,.7), transparent);
  background-size: 300px 300px;
  animation: nevar 18s linear infinite;
}
@keyframes nevar { from { background-position: 0 0; } to { background-position: 60px 300px; } }

.hero-grid { position: relative; z-index: 2; display: grid; grid-template-columns: 1.25fr 1fr; gap: 48px; align-items: center; }
.selo {
  display: inline-flex; align-items: center; gap: .5rem; margin: 0 0 1rem;
  padding: .35rem .85rem; border-radius: 99px; font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); backdrop-filter: blur(4px);
}
.curso {
  font-family: Fraunces, Georgia, serif; font-style: italic; font-weight: 600;
  font-size: clamp(1.25rem, 3vw, 1.7rem); color: var(--dourado-claro); margin: 0 0 .35rem;
}
.hero h1 { font-size: clamp(2.3rem, 6vw, 3.9rem); margin: 0 0 1rem; font-weight: 800; letter-spacing: -.01em; text-wrap: balance; }
.hero-sub { font-size: 1.08rem; opacity: .85; max-width: 38ch; margin: 0 0 1.75rem; }

/* Bilhete do prêmio */
.bilhete {
  position: relative; color: var(--tinta); background: var(--creme); border-radius: 22px;
  box-shadow: var(--sombra-forte); transform: rotate(2deg); transition: transform .3s;
}
.bilhete:hover { transform: rotate(0deg) scale(1.01); }
.bilhete-topo { padding: 28px 28px 22px; text-align: center; }
.bilhete-icone {
  display: grid; place-items: center; width: 84px; height: 84px; margin: -70px auto 12px; font-size: 2.8rem;
  border-radius: 50%; background: linear-gradient(145deg, var(--dourado-claro), var(--dourado));
  box-shadow: 0 0 0 6px var(--creme), 0 10px 24px rgba(0,0,0,.25);
}
.bilhete-topo .eyebrow { color: var(--vermelho); opacity: 1; }
.bilhete-topo strong { display: block; font-family: Fraunces, Georgia, serif; font-size: clamp(1.6rem, 4vw, 2.1rem); line-height: 1.1; color: var(--verde-esc); }
.bilhete-topo p { margin: .5rem 0 0; color: var(--muted); }
.bilhete-corte { position: relative; height: 0; border-top: 2px dashed #d9cfb9; margin: 0 22px; }
.bilhete-corte::before, .bilhete-corte::after {
  content: ""; position: absolute; top: -15px; width: 28px; height: 28px; border-radius: 50%; background: var(--verde);
}
.bilhete-corte::before { left: -37px; }
.bilhete-corte::after { right: -37px; }
.bilhete-base { display: grid; grid-template-columns: 1fr 1fr; padding: 18px 20px 22px; text-align: center; }
.bilhete-base div + div { border-left: 1px solid var(--linha); }
.bilhete-base span { display: block; font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.bilhete-base strong { font-family: Fraunces, Georgia, serif; font-size: clamp(1.15rem, 4.5vw, 1.45rem); color: var(--vermelho); white-space: nowrap; }

.hero-onda { position: absolute; left: 0; bottom: -1px; width: 100%; height: 60px; z-index: 2; fill: var(--creme); }

/* =================== PLACAR =================== */
.placar {
  position: relative; z-index: 3; margin: -78px 0 28px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0;
  background: var(--papel); border-radius: var(--raio); box-shadow: var(--sombra), 0 20px 40px -24px rgba(15, 42, 31, .35);
  border: 1px solid var(--linha);
}
.placar-item { display: flex; align-items: center; gap: 14px; padding: 20px 22px; }
.placar-item + .placar-item { border-left: 1px solid var(--linha); }
.placar-icone { display: grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 14px; background: #f5efe2; font-size: 1.4rem; }
.placar-item strong { display: block; font-family: Fraunces, Georgia, serif; font-size: 1.6rem; line-height: 1.1; color: var(--verde-esc); }
.placar-item span:not(.placar-icone) { font-size: .85rem; color: var(--muted); }
.placar-barra { grid-column: 1 / -1; padding: 0 22px 18px; }
.placar-barra small { display: block; margin-top: 6px; color: var(--muted); font-size: .8rem; text-align: right; }

.barra { height: 12px; background: #f1ebdf; border-radius: 99px; overflow: hidden; box-shadow: inset 0 1px 2px rgba(0,0,0,.06); }
.barra span {
  display: block; height: 100%; border-radius: 99px; transition: width .6s;
  background: repeating-linear-gradient(-45deg, var(--vermelho) 0 10px, #e0584a 10px 20px);
  background-size: 28px 28px; animation: listras 1.2s linear infinite;
}
@keyframes listras { to { background-position: 28px 0; } }

/* =================== CARDS / FORMULÁRIOS =================== */
.card {
  background: var(--papel); border: 1px solid var(--linha); border-radius: var(--raio);
  padding: 24px; margin-bottom: 24px; box-shadow: var(--sombra);
}
label { display: block; font-weight: 500; font-size: .92rem; margin-bottom: .9rem; }
input[type=text], input[type=tel], input[type=search], input[type=password], input[type=number],
input[type=datetime-local], select, textarea {
  display: block; width: 100%; margin-top: .3rem; padding: .7rem .85rem; font: inherit;
  border: 1.5px solid #ddd5c4; border-radius: 12px; background: #fff; color: var(--tinta);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--dourado); box-shadow: 0 0 0 4px rgba(224, 168, 62, .2); }
input:disabled { background: #f6f2ea; color: var(--muted); }
.linha > input { flex: 1; margin-top: 0; min-width: 180px; }
.check { display: inline-flex; align-items: center; gap: .4rem; margin: 0; font-weight: 500; white-space: nowrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .7rem 1.2rem; border-radius: 12px; border: 1.5px solid var(--verde);
  background: var(--verde); color: #fff; font: inherit; font-weight: 600; cursor: pointer;
  text-decoration: none; white-space: nowrap; transition: transform .1s, background .15s, box-shadow .15s;
}
.btn:hover { background: var(--verde-esc); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.sec { background: #fff; color: var(--verde); border-color: #d6cfbf; }
.btn.sec:hover { background: #f6f2ea; border-color: var(--verde); }
.btn.perigo { background: var(--vermelho); border-color: var(--vermelho); }
.btn.whats { background: #1f9d55; border-color: #1f9d55; }
.btn.whats:hover { background: #17824a; }
.btn.dourado {
  background: linear-gradient(180deg, #f2c25e, var(--dourado)); border-color: #c98f27; color: #3b2a07;
  box-shadow: 0 6px 18px -6px rgba(224, 168, 62, .7);
}
.btn.dourado:hover { background: linear-gradient(180deg, #f6cd72, #d89c30); }
.btn.pequeno { padding: .45rem .8rem; font-size: .85rem; border-radius: 10px; }
.btn.grande { padding: .95rem 1.8rem; font-size: 1.08rem; border-radius: 14px; }

.alert { padding: .8rem 1rem; border-radius: 12px; margin: 0 0 1rem; }
.alert.ok { background: #e3f1e8; color: #17462e; }
.alert.erro { background: #fbe6e3; color: #7d1f18; }
.alert.info { background: #fff4d9; color: #6b4d0d; }

/* =================== AVISO DO VENDEDOR =================== */
.aviso-vendedor {
  display: flex; align-items: center; gap: 14px; margin-bottom: 24px; padding: 14px 18px;
  background: linear-gradient(90deg, #fff6df, #fffbf1); border: 1px solid #f1dfae; border-radius: var(--raio);
}
.aviso-vendedor p { margin: 0; }
.avatar {
  display: grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 50%;
  background: var(--verde); color: #fff; font: 700 1.2rem Fraunces, Georgia, serif; box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--dourado);
}

/* =================== COMO PARTICIPAR =================== */
.passos { margin-bottom: 28px; }
.passos ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; counter-reset: passo; }
.passos li {
  position: relative; display: flex; flex-direction: column; gap: 4px; padding: 18px;
  background: var(--papel); border: 1px solid var(--linha); border-radius: var(--raio); box-shadow: var(--sombra);
}
.passos li strong { font-family: Fraunces, Georgia, serif; font-size: 1.1rem; }
.passos li span:last-child { font-size: .88rem; color: var(--muted); }
.passo-n {
  display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 6px; border-radius: 10px;
  background: var(--verde); color: #fff; font: 800 1rem Fraunces, Georgia, serif;
}
.passos li:nth-child(2) .passo-n { background: var(--vermelho); }
.passos li:nth-child(3) .passo-n { background: var(--dourado); color: #3b2a07; }
.passos li:nth-child(4) .passo-n { background: var(--verde-claro); }

/* =================== CARTELA DE NÚMEROS =================== */
.grade-topo { display: flex; flex-wrap: wrap; gap: 12px 20px; justify-content: space-between; align-items: flex-end; margin-bottom: 1rem; }
.grade-topo .titulo-secao { margin-bottom: .75rem; }
.filtros { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.busca { position: relative; }
.busca svg { position: absolute; left: 11px; top: 50%; width: 17px; height: 17px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 2.2; stroke-linecap: round; }
.busca input { width: 140px; margin: 0; padding-left: 34px; border-radius: 99px; }

.interruptor { display: inline-flex; align-items: center; gap: .5rem; margin: 0; cursor: pointer; font-size: .9rem; user-select: none; }
.interruptor input { position: absolute; opacity: 0; pointer-events: none; }
.interruptor span { position: relative; width: 38px; height: 22px; border-radius: 99px; background: #d9d2c3; transition: background .2s; }
.interruptor span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.interruptor input:checked + span { background: var(--verde); }
.interruptor input:checked + span::after { transform: translateX(16px); }
.interruptor input:focus-visible + span { box-shadow: 0 0 0 3px rgba(224, 168, 62, .45); }

.legenda { list-style: none; padding: 0; margin: 0; display: flex; gap: 14px; flex-wrap: wrap; font-size: .82rem; color: var(--muted); }
.legenda li { display: flex; align-items: center; gap: 6px; }
.q { display: inline-block; width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid #ddd5c4; }
.q.livre { background: #fff; }
.q.sel { background: var(--vermelho); border-color: var(--vermelho); }
.q.res { background: var(--res); border-color: #f0d995; }
.q.pago { background: var(--pago); border-color: #c9d8ce; }

.faixas { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 10px; margin-bottom: 10px; scrollbar-width: thin; }
.faixa {
  flex: none; font: 600 .8rem/1 Inter, sans-serif; padding: .5rem .8rem; border-radius: 99px;
  border: 1.5px solid #e2dacb; background: #fff; color: var(--tinta); cursor: pointer; font-variant-numeric: tabular-nums;
  transition: background .15s, border-color .15s;
}
.faixa:hover { border-color: var(--verde); }
.faixa.ativa { background: var(--verde); border-color: var(--verde); color: #fff; }

.grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 8px; }
.num {
  position: relative; font: 700 .92rem/1 ui-monospace, "SF Mono", Consolas, monospace; padding: .8rem 0;
  border-radius: 10px; border: 1.5px solid #e6dfcf; background: #fff; color: var(--verde-esc); cursor: pointer;
  transition: transform .12s, background .15s, box-shadow .15s, border-color .15s;
  /* recortes laterais de bilhete */
  -webkit-mask: radial-gradient(circle 5px at 0 50%, #0000 96%, #000) left / 51% 100% no-repeat,
                radial-gradient(circle 5px at 100% 50%, #0000 96%, #000) right / 51% 100% no-repeat;
          mask: radial-gradient(circle 5px at 0 50%, #0000 96%, #000) left / 51% 100% no-repeat,
                radial-gradient(circle 5px at 100% 50%, #0000 96%, #000) right / 51% 100% no-repeat;
}
.num:hover:not(:disabled) { border-color: var(--verde); background: #f4faf6; transform: translateY(-2px); box-shadow: 0 6px 14px -6px rgba(31, 77, 58, .4); }
.num:focus-visible { outline: 3px solid var(--dourado); outline-offset: 2px; }
.num.sel {
  background: linear-gradient(160deg, #d9493a, var(--vermelho-esc)); border-color: var(--vermelho-esc); color: #fff;
  transform: translateY(-2px); box-shadow: 0 8px 16px -6px rgba(192, 57, 43, .6);
}
.num.sel:hover:not(:disabled) { background: linear-gradient(160deg, #c9402f, #8a2419); }
.num.res { background: var(--res); border-color: #f0d995; color: #a07c26; cursor: not-allowed; }
.num.pago { background: var(--pago); border-color: #d3e0d7; color: #9bb1a3; cursor: not-allowed; }
.num:disabled:not(.res):not(.pago) { cursor: not-allowed; opacity: .55; }
.num.pulse { animation: pulse 1.2s ease; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(192,57,43,.6); } 50% { box-shadow: 0 0 0 12px rgba(192,57,43,0); } }

/* Barra de seleção */
.barra-sel {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; padding: 14px 0;
  background: rgba(255,255,255,.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 3px solid var(--dourado); box-shadow: 0 -10px 30px rgba(15, 42, 31, .12);
  animation: subir .25s ease-out;
}
@keyframes subir { from { transform: translateY(100%); } }
.barra-sel-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.barra-sel-info { display: grid; grid-template-columns: auto auto; align-items: baseline; gap: 0 14px; min-width: 0; }
.barra-sel-qtd { color: var(--muted); }
.barra-sel-qtd strong { color: var(--tinta); }
.barra-sel-total { font-family: Fraunces, Georgia, serif; font-size: 1.5rem; color: var(--vermelho); }
.barra-sel-lista { grid-column: 1 / -1; font: .8rem ui-monospace, Consolas, monospace; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55vw; }
.barra-sel-acoes { display: flex; gap: 8px; }

/* =================== MODAL =================== */
.modal {
  border: none; border-radius: 22px; padding: 0; width: min(480px, calc(100vw - 32px)); max-height: calc(100vh - 32px);
  box-shadow: 0 30px 80px rgba(0,0,0,.35); color: var(--tinta);
}
.modal[open] { animation: aparecer .22s ease-out; }
@keyframes aparecer { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.modal::backdrop { background: rgba(10, 25, 18, .6); backdrop-filter: blur(3px); }
.modal > div { padding: 0 24px 24px; }
.modal-topo {
  display: flex; align-items: center; gap: 12px; margin: 0 -24px 18px; padding: 20px 24px;
  background: linear-gradient(135deg, var(--verde), var(--verde-esc)); color: #fff;
}
.modal-topo.sucesso { background: linear-gradient(135deg, #2f7a55, var(--verde)); }
.modal-topo span { font-size: 1.8rem; }
.modal-topo h2 { margin: 0; }
.modal-resumo { margin-bottom: 1rem; padding: 12px 14px; border-radius: 14px; background: #f8f4ea; }
.modal-resumo p { margin: .5rem 0 0; }
.modal-resumo strong { color: var(--vermelho); font-size: 1.1rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 96px; overflow-y: auto; }
.chip { padding: .25rem .55rem; border-radius: 8px; background: #fff; border: 1.5px solid #f0c9c3; color: var(--vermelho-esc); font: 700 .85rem ui-monospace, Consolas, monospace; }
.valor-pagar { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 14px; border-radius: 14px; background: #f8f4ea; }
.valor-pagar strong { font-family: Fraunces, Georgia, serif; font-size: 1.6rem; color: var(--vermelho); }
.pix { background: #fffaf0; border: 2px dashed var(--dourado); border-radius: 14px; padding: 12px 14px; margin: 1rem 0; }
.pix-rotulo { display: block; font-size: .8rem; color: var(--muted); margin-bottom: 4px; }
.pix code { font-size: 1rem; font-weight: 600; word-break: break-all; flex: 1; }

/* =================== VENCEDOR =================== */
.vencedor {
  position: relative; overflow: hidden; text-align: center; padding-top: 56px;
  border: 2px solid var(--dourado); background: radial-gradient(ellipse at 50% 0%, #fff4d6, #fff 70%);
}
.vencedor-fita {
  position: absolute; top: 0; left: 0; right: 0; padding: .5rem; font-weight: 700; color: #fff;
  background: linear-gradient(90deg, var(--vermelho-esc), var(--vermelho), var(--vermelho-esc));
}
.vencedor-num { font-size: clamp(3.5rem, 14vw, 6rem); font-weight: 800; color: var(--vermelho); letter-spacing: .05em; text-shadow: 0 4px 0 var(--dourado-claro); }
.vencedor-nome { font-size: 1.25rem; margin: .25rem 0; }

/* =================== CONSULTA =================== */
.consulta { display: grid; grid-template-columns: 1fr 1.2fr; gap: 8px 32px; align-items: center; }
.consulta .titulo-secao { margin-bottom: .6rem; }
.consulta p { margin: 0; }
.consulta #resultadoConsulta { grid-column: 1 / -1; }
.meus { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.meus li { display: flex; gap: 12px; align-items: center; padding: .6rem .85rem; border-radius: 12px; background: #fff8e6; border: 1px solid #f3e2b3; font-size: .88rem; }
.meus li.pago { background: #eaf4ee; border-color: #cfe3d6; }
.meus strong { font-family: ui-monospace, Consolas, monospace; font-size: 1.1rem; }

.rodape { text-align: center; padding: 16px 0 48px; font-size: .92rem; }
.rodape p { margin: .3rem 0; }
.rodape-marca { font-family: Fraunces, Georgia, serif; font-size: 1.1rem; font-style: italic; color: var(--verde); }

/* =================== ADMIN =================== */
.admin-topo { background: linear-gradient(90deg, var(--verde-esc), var(--verde)); color: #fff; box-shadow: 0 2px 12px rgba(0,0,0,.15); }
.admin-topo .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }
.admin-topo strong { font-family: Fraunces, Georgia, serif; font-size: 1.1rem; }
.admin-topo nav { display: flex; gap: 4px; flex-wrap: wrap; }
.admin-topo nav a { color: #fff; text-decoration: none; padding: .4rem .75rem; border-radius: 8px; font-size: .92rem; opacity: .85; }
.admin-topo nav a:hover, .admin-topo nav a.ativo { background: rgba(255,255,255,.14); opacity: 1; }
.admin main { padding-top: 24px; padding-bottom: 40px; }
.admin h1 { font-size: 1.7rem; margin: 0 0 1rem; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi { background: #fff; border: 1px solid var(--linha); border-radius: var(--raio); padding: 16px 18px; box-shadow: var(--sombra); border-top: 4px solid var(--verde); }
.kpi:nth-child(2) { border-top-color: var(--dourado); }
.kpi:nth-child(3) { border-top-color: #9bb1a3; }
.kpi:nth-child(4) { border-top-color: var(--vermelho); }
.kpi span { display: block; font-size: .8rem; color: var(--muted); }
.kpi strong { font-size: 1.7rem; font-family: Fraunces, Georgia, serif; }
.kpi small { display: block; color: var(--muted); }

.tabela-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--linha); vertical-align: middle; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; white-space: nowrap; }
th a { color: inherit; text-decoration: none; }
td.n { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
tr:hover td { background: #fcfaf5; }
.mono { font-family: ui-monospace, Consolas, monospace; }

.prog { display: flex; align-items: center; gap: 8px; min-width: 160px; }
.prog-barra { flex: 1; height: 10px; background: #eee8db; border-radius: 99px; overflow: hidden; display: flex; }
.prog-barra .p { background: var(--verde); }
.prog-barra .r { background: var(--dourado); }
.prog small { width: 42px; text-align: right; color: var(--muted); }

.tag { display: inline-block; padding: .15rem .55rem; border-radius: 99px; font-size: .78rem; font-weight: 600; }
.tag.pago { background: #e3f1e8; color: #17462e; }
.tag.reservado { background: #fff1cc; color: #6b4d0d; }
.tag.alerta { background: #fbe6e3; color: #7d1f18; }
.tag.ok { background: #e3f1e8; color: #17462e; }

.filtro-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 1rem; }
.filtro-form label { margin: 0; flex: 1; min-width: 150px; }
.acoes { display: flex; gap: 6px; flex-wrap: wrap; }
.acoes form { margin: 0; }

.admin-login {
  display: grid; place-items: center; min-height: 100vh; padding: 16px;
  background: radial-gradient(ellipse at 50% 0%, #23593f, var(--verde-esc) 70%);
}
.login-card { width: min(380px, 100%); }
.login-card h1 { margin-top: 0; }

.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 20px; }

/* =================== SORTEIO =================== */
.palco {
  position: relative; overflow: hidden;
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 30%, #23593f 0%, var(--verde-esc) 70%); color: #fff; padding: 24px 16px; text-align: center;
}
.palco > *:not(.neve) { position: relative; z-index: 1; }
.palco .curso { margin-bottom: .1rem; }
.palco h1 { font-size: clamp(1.4rem, 3.5vw, 2.4rem); margin: 0 0 .25rem; }
.palco .sub { opacity: .8; margin: 0 0 1.5rem; }
.roleta-box { position: relative; width: min(520px, 88vw); aspect-ratio: 1; }
.roleta-box canvas { width: 100%; height: 100%; display: block; border-radius: 50%; box-shadow: 0 0 0 10px #0f2a1e, 0 0 0 14px var(--dourado), 0 20px 60px rgba(0,0,0,.5); }
.ponteiro {
  position: absolute; top: -18px; left: 50%; transform: translateX(-50%); width: 0; height: 0;
  border-left: 20px solid transparent; border-right: 20px solid transparent; border-top: 40px solid var(--vermelho);
  filter: drop-shadow(0 4px 4px rgba(0,0,0,.4)); z-index: 2;
}
.centro {
  position: absolute; inset: 0; margin: auto; width: 34%; height: 34%; border-radius: 50%;
  background: #fff; color: var(--verde-esc); display: grid; place-items: center;
  box-shadow: 0 0 0 6px var(--dourado), 0 8px 24px rgba(0,0,0,.35);
  font: 800 clamp(1.6rem, 6vw, 3rem) ui-monospace, Consolas, monospace;
}
.palco .btn.grande { margin-top: 28px; background: var(--vermelho); border-color: var(--vermelho); }
.palco .btn.grande:hover { background: #9c2821; }
.resultado { margin-top: 24px; min-height: 120px; }
.resultado .nome { font-family: Fraunces, Georgia, serif; font-size: clamp(1.6rem, 5vw, 2.8rem); color: var(--dourado); margin: 0; }
.resultado p { margin: .25rem 0; }
.palco-links { position: fixed !important; top: 12px; left: 12px; display: flex; gap: 8px; }
.palco-links a { color: #fff; opacity: .6; font-size: .85rem; }
.confete { position: fixed; top: -20px; width: 10px; height: 14px; z-index: 50; pointer-events: none; animation: cair linear forwards; }
@keyframes cair { to { transform: translateY(110vh) rotate(720deg); } }

/* =================== RESPONSIVO =================== */
@media (max-width: 860px) {
  .hero { padding: 76px 0 120px; }
  .hero-grid { grid-template-columns: 1fr; gap: 64px; }
  .bilhete { max-width: 420px; width: 100%; margin: 0 auto; transform: rotate(1.5deg); }
  .passos ol { grid-template-columns: repeat(2, 1fr); }
  .consulta { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .hero { text-align: center; }
  .hero-sub { margin-left: auto; margin-right: auto; }
  .placar { grid-template-columns: repeat(3, 1fr); margin-top: -70px; }
  .placar-item { flex-direction: column; text-align: center; gap: 6px; padding: 14px 6px; }
  .placar-icone { width: 38px; height: 38px; font-size: 1.15rem; border-radius: 12px; }
  .placar-item strong { font-size: 1.25rem; }
  .placar-item span:not(.placar-icone) { font-size: .72rem; line-height: 1.25; display: block; }
  .placar-barra { padding: 0 14px 14px; }
  .passos ol { gap: 10px; }
  .passos li { padding: 14px; }
  .grade-topo { align-items: stretch; }
  .filtros { width: 100%; }
  .busca { flex: 1; }
  .busca input { width: 100%; }
  .grade { grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 6px; }
  .num { font-size: .84rem; padding: .7rem 0; }
  .card { padding: 18px; }
  .barra-sel-in { flex-direction: column; align-items: stretch; gap: 10px; }
  .barra-sel-lista { max-width: calc(100vw - 32px); }
  .barra-sel-acoes .btn { flex: 1; }
  .modal-topo { padding: 16px 20px; }
  .modal > div { padding: 0 20px 20px; }
  .modal-topo { margin: 0 -20px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
@media print {
  .admin-topo, .filtro-form, .acoes, .btn { display: none !important; }
  .card { box-shadow: none; border: none; }
}
