/* Tema único (claro): simples como o Termo, mas com cara de volante. Verde da Mega para os números marcados. */
:root {
  --bg: #f4f6f3;
  --text: #1f2a24;
  --muted: #66716b;
  --line: #d5ddd7;
  --card: #ffffff;
  --verde: #209869;      /* marcado */
  --verde-escuro: #17734f;
  --ball: #ffffff;
  --ball-line: #c9d3cc;
  --off: #eceeec;        /* com 6 marcados, o resto fica cinza */
  --off-ink: #b5bcb7;
  --ouro: #b88a00;
  --alerta: #b5651d;
  --toast: #1f2a24;
  --shade: rgba(31, 42, 36, .45);
}
/* Nunito (SIL Open Font License), hospedada aqui: sem chamar o Google Fonts */
@font-face { font-family: "Nunito"; src: url("/fonts/nunito.woff2") format("woff2"); font-weight: 200 1000; font-display: swap; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 18px/1.45 "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }

/* ---------- cabeçalho ---------- */
.top {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  max-width: 520px; margin: 0 auto; padding: 10px 16px 4px;
}
.top .left, .top .right { display: flex; gap: 6px; }
.top .right { justify-content: flex-end; }
.icon {
  width: 38px; height: 38px; border: 2px solid var(--line); border-radius: 50%; background: transparent;
  font-weight: 800; font-size: 1rem; display: grid; place-items: center; padding: 0; text-decoration: none; line-height: 1;
}
.icon svg { display: block; }
.brand {
  display: flex; align-items: center; gap: 7px; font-weight: 900; font-size: clamp(1.05rem, 5vw, 1.45rem);
  text-decoration: none; white-space: nowrap; letter-spacing: -.01em;
}
.logo { width: 22px; height: 22px; border-radius: 50%; background: var(--verde); box-shadow: inset -4px -4px 0 rgba(0, 0, 0, .15); flex: none; }

/* barra do menu */
.menu {
  background: var(--text); color: #fff; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px;
  padding: 8px 52px 8px 12px; position: relative; animation: drop .2s ease-out;
}
.menu a { color: #fff; text-decoration: none; font-weight: 700; padding: 6px 10px; white-space: nowrap; border-radius: 6px; }
.menu a.atual { opacity: .45; }
.menu a.premium { background: var(--verde); }
.menu .info { position: absolute; right: 8px; top: 8px; font-size: 1.4rem; padding: 2px 8px; }
@keyframes drop { from { transform: translateY(-100%); } to { transform: none; } }

/* ---------- jogo ---------- */
main { max-width: 520px; margin: 0 auto; padding: 0 16px 24px; }
.headline { text-align: center; font-size: clamp(1.35rem, 6.2vw, 1.75rem); line-height: 1.15; margin: 14px 0 14px; font-weight: 900; letter-spacing: -.01em; }
.volante { background: var(--card); border-radius: 18px; padding: 12px 10px 14px; box-shadow: 0 1px 0 var(--line), 0 6px 20px rgba(31, 42, 36, .06); }
.vol-top { display: flex; justify-content: space-between; align-items: baseline; padding: 0 4px 10px; font-size: .95rem; }
.vol-top span:first-child { font-weight: 900; color: var(--verde); }
.vol-top span:last-child { font-weight: 700; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; max-width: 360px; margin: 0 auto; }
.tile {
  aspect-ratio: 1; border: 2px solid var(--ball-line); border-radius: 50%; background: var(--ball);
  font-weight: 800; font-size: clamp(1.15rem, 5.4vw, 1.4rem); padding: 0; color: var(--text);
  display: grid; place-items: center; user-select: none; font-variant-numeric: tabular-nums;
  transition: background .15s, color .15s, border-color .15s;
}
.tile.on { background: var(--verde); border-color: var(--verde); color: #fff; animation: pop .14s ease-out; }
.tile:disabled { background: var(--off); border-color: var(--off); color: var(--off-ink); cursor: default; }
@keyframes pop { 50% { transform: scale(1.15); } }

.actions { display: flex; gap: 8px; justify-content: center; margin: 14px auto 0; }
.actions.col { flex-direction: column; }
.link { border: 0; background: transparent; color: var(--muted); text-decoration: underline; font-weight: 700; padding: 6px; align-self: center; }
.btn {
  border: 0; border-radius: 999px; padding: 14px 18px; font-weight: 800; font-size: 1.05rem;
  background: var(--verde); color: #fff; flex: 1; text-decoration: none; text-align: center;
}
.btn.ghost { background: transparent; color: var(--text); border: 2px solid var(--line); flex: 0 0 auto; }
.btn:disabled { opacity: .6; }

/* ---------- aviso (toast) ---------- */
.toast {
  position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 30;
  background: var(--toast); color: #fff; padding: 10px 18px; border-radius: 999px; font-weight: 700;
  max-width: calc(100% - 32px); text-align: center; animation: fade 2.2s ease forwards; pointer-events: none;
}
@keyframes fade { 0% { opacity: 0; } 10%, 80% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- cartões sobrepostos (resultado, ajuda) ---------- */
.overlay { position: fixed; inset: 0; background: var(--shade); z-index: 20; display: grid; place-items: center; padding: 16px; }
.modal {
  background: var(--card); border-radius: 20px; padding: 24px 20px 18px; width: 100%; max-width: 420px;
  position: relative; text-align: center; animation: rise .25s ease-out; max-height: calc(100vh - 32px); overflow-y: auto;
}
@keyframes rise { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.close { position: absolute; z-index: 2; top: 8px; right: 10px; border: 0; background: transparent; font-size: 1.6rem; line-height: 1; padding: 6px; color: var(--muted); }

/* "pensando": três bolas quicando, como no sorteio */
.modal .pensando-box { display: none; padding: 26px 0 18px; }
.modal.pensando .pensando-box { display: block; }
.modal.pensando .resultado-box, .modal.pensando .close { display: none; }
.bolas { display: flex; gap: 10px; justify-content: center; margin-bottom: 18px; }
.bolas span { width: 22px; height: 22px; border-radius: 50%; background: var(--verde); animation: quica .9s ease-in-out infinite; }
.bolas span:nth-child(2) { animation-delay: .15s; }
.bolas span:nth-child(3) { animation-delay: .3s; }
@keyframes quica { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-16px); } }
#p-msg { font-weight: 700; font-size: 1.1rem; margin: 0; min-height: 2.9em; }

.r-emoji { font-size: 3.6rem; line-height: 1; animation: pop .3s ease-out; }
.r-title { font-weight: 900; font-size: 1.7rem; margin: 8px 0 6px; line-height: 1.1; }
.modal.ouro .r-title { color: var(--ouro); }
.modal.esperto .r-title { color: var(--verde-escuro); }
.modal.multidao .r-title, .modal.popular .r-title { color: var(--alerta); }
.r-frase { font-size: 1.1rem; margin: 0 0 14px; white-space: pre-line; }
.r-nums { display: flex; justify-content: center; gap: 6px; margin-bottom: 4px; }
.r-nums span { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; color: #fff; background: var(--verde); font-size: 1.05rem; }
.modal .actions { flex-direction: column; }
.modal .actions .btn { flex: none; }
.r-nota { font-size: .9rem; color: var(--muted); margin: 12px 0 0; }
.ad {
  margin: 14px auto 0; width: 100%; max-width: 320px; height: 100px; border: 2px dashed var(--line); border-radius: 10px;
  display: grid; place-items: center; color: var(--muted); font-size: .85rem;
}
.help h2 { font-size: 1.3rem; line-height: 1.2; margin: 2px 24px 8px; }
.help p { text-align: left; margin: 8px 0; font-size: .95rem; line-height: 1.4; }
.help p.centro { text-align: center; font-weight: 700; margin-top: 14px; }
.verde { color: var(--verde); }

/* ---------- páginas simples (sobre, premium, em breve) ---------- */
.page { text-align: center; padding-top: 20px; }
.page h1 { font-size: 1.8rem; margin: 10px 0; line-height: 1.15; }
.page p { color: var(--muted); }
.cards { display: grid; gap: 12px; margin: 18px 0; text-align: left; }
.card { background: var(--card); border-radius: 16px; padding: 16px; border: 2px solid var(--line); }
.card h2 { font-size: 1.15rem; margin: 0 0 6px; }
.card p { margin: 0 0 10px; color: var(--text); }

/* comparação grátis × premium */
.planos { width: 100%; border-collapse: collapse; margin: 16px 0 6px; background: var(--card); border-radius: 16px; overflow: hidden; font-size: .98rem; }
.planos th, .planos td { padding: 10px 8px; border-bottom: 1px solid var(--line); }
.planos th { font-size: .9rem; }
.planos td:first-child { text-align: left; }
.planos td:not(:first-child), .planos th:not(:first-child) { text-align: center; width: 76px; }
.planos th.pro { color: var(--verde-escuro); }
.ofertas { display: grid; gap: 12px; margin: 16px 0; text-align: left; }
.oferta { background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 16px; }
.oferta.destaque { border-color: var(--verde); }
.oferta .preco { font-size: 1.6rem; font-weight: 900; }
.oferta .preco small { font-size: .95rem; font-weight: 700; color: var(--muted); }
.oferta p { margin: 4px 0 12px; color: var(--text); }
.oferta .btn { width: 100%; display: block; }

@media (max-width: 400px) { .top .logo { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .tile.on, .modal, .menu, .r-emoji, .bolas span { animation: none; }
}
