:root {
  --bg: #f7f5f9;
  --bg-2: #efeaf4;
  --panel: #ffffff;
  --panel-2: #fbfafc;
  --line: rgba(122, 36, 143, 0.12);
  --line-strong: rgba(122, 36, 143, 0.18);
  --gold: #f3e08a;
  --gold-2: #f8ecc4;
  --cream: #24152e;
  --muted: #6e5c7a;
  --green: #7a248f;
  --amber: #9a6b00;
  --rose: #b54a5a;
  --ink: #24152e;
  --purple: #8e24aa;
  --purple-2: #a63bb8;
  --ticket: #f6ebb0;
  --ticket-ink: #7a248f;
  --shadow: 0 10px 28px rgba(80, 30, 100, 0.08);
  --radius: 18px;
  --font: "Inter", "Segoe UI", sans-serif;
  --serif: "Inter", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
  background: var(--bg);
  overflow-x: hidden;
  color-scheme: light;
}
body {
  font-family: var(--font);
  color: var(--cream);
  background: var(--bg);
  min-height: 100%;
  line-height: 1.45;
  overflow-x: hidden;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 16px calc(72px + env(safe-area-inset-bottom, 0px));
  min-width: 0;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin-bottom: 22px;
  min-width: 0;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
  flex: 1 1 auto;
}

.brand > div { min-width: 0; }

.mark {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--ticket-ink);
  color: #fff;
  font-family: var(--font);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.04em;
}

.brand h1 {
  margin: 0;
  font-family: var(--font);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
}

.brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.pill-meta {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 8px 12px;
  text-align: right;
  flex: 0 0 auto;
}

.pill-meta small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pill-meta strong { font-size: 18px; font-variant-numeric: tabular-nums; }

.hero {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px 20px 18px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  min-width: 0;
}

.hero h2 {
  margin: 0 0 8px;
  font-family: var(--font);
  font-size: clamp(22px, 7vw, 30px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
}

.hero .lede {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 15px;
  overflow-wrap: anywhere;
}

.kicker {
  display: block;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 11px;
}

.last-meta {
  margin: 8px 0 16px;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.ultimo-bolas {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(30px, 1fr));
  gap: 6px;
  margin: 8px 0 0;
  justify-items: start;
}

.ultimo-bolas .ball {
  width: 100%;
  max-width: 34px;
  height: auto;
  aspect-ratio: 1;
}

.qty {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.qty button,
.switch,
.btn {
  border: 1px solid var(--line);
  background: var(--bg-2);
  border-radius: 12px;
  min-height: 48px;
}

.qty button {
  color: var(--cream);
  font-weight: 600;
  padding: 0 8px;
  font-size: 14px;
  min-width: 0;
}

.qty button[aria-pressed="true"] {
  background: var(--ticket-ink);
  color: #fff;
  border-color: var(--ticket-ink);
}

.toggles { display: grid; gap: 8px; margin-bottom: 14px; }

.switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  text-align: left;
  width: 100%;
  min-width: 0;
}

.switch span { display: block; min-width: 0; flex: 1; }
.switch small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; font-weight: 400; }
.switch strong { font-size: 14px; font-weight: 600; }

.knob {
  width: 44px;
  height: 26px;
  border-radius: 99px;
  background: #ddd6e3;
  position: relative;
  flex: 0 0 auto;
  border: 1px solid transparent;
}

.knob::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  top: 2px;
  left: 3px;
  transition: transform 0.18s ease;
  box-shadow: 0 1px 3px rgba(36, 21, 46, 0.18);
}

.switch[aria-pressed="true"] .knob {
  background: var(--ticket-ink);
  border-color: var(--ticket-ink);
}
.switch[aria-pressed="true"] .knob::after {
  transform: translateX(16px);
  background: white;
}

.btn {
  width: 100%;
  min-height: 54px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.btn-primary {
  background: var(--ticket-ink);
  color: #fff;
  border-color: transparent;
  font-size: 16px;
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: wait;
}

.btn-ghost {
  background: transparent;
  color: var(--cream);
}

.actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 4px;
}

.actions[hidden] {
  display: none !important;
}

.ball {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--ticket-ink);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  border: 1px solid rgba(122, 36, 143, 0.16);
}

.ball.hit {
  background: var(--purple);
  color: #fff;
  border-color: var(--purple);
}

.ball.miss {
  background: #f0eaf4;
  color: #9a8aa6;
  border-color: transparent;
}

.status {
  min-height: 22px;
  color: var(--muted);
  font-size: 13px;
  margin: 10px 0 0;
}

.game {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  animation: rise 0.35s ease both;
  min-width: 0;
  overflow: hidden;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.game-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.game-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.selo {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 5px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  flex: 0 1 auto;
  text-align: right;
}

.selo.padrao { background: rgba(122, 36, 143, 0.1); color: var(--ticket-ink); }
.selo.limite { background: rgba(154, 107, 0, 0.12); color: var(--amber); }
.selo.atipico { background: rgba(181, 74, 90, 0.12); color: var(--rose); }

.ticket {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: start;
  min-width: 0;
}

.mini-volante {
  display: none;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  width: min(196px, 100%);
  background: var(--ticket);
  padding: 8px;
  border-radius: 14px;
  border: 1px solid rgba(232, 196, 92, 0.4);
}

.cell {
  aspect-ratio: 1;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--ticket-ink);
  background: #fff;
}

.cell.on {
  background: var(--ticket-ink);
  color: #fff;
}

.cell.hit {
  background: var(--purple-2);
  color: #fff;
}

.nums {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  width: min(280px, 100%);
}

.nums .ball {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
}

.metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.chip {
  font-size: 11px;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  color: var(--cream);
  white-space: nowrap;
}

.chip.core { border-color: rgba(122, 36, 143, 0.35); color: var(--ticket-ink); }
.chip.wide { border-color: rgba(154, 107, 0, 0.35); color: var(--amber); }
.chip.out { border-color: rgba(181, 74, 90, 0.4); color: var(--rose); }

.game-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  gap: 8px;
}

.acertos {
  font-size: 13px;
  font-weight: 700;
  color: var(--ticket-ink);
}

.linkish {
  background: none;
  border: 0;
  color: var(--ticket-ink);
  min-height: auto;
  padding: 0;
  font-size: 13px;
  font-weight: 600;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin: 16px 0;
  min-width: 0;
}

.panel h2 {
  margin: 0 0 6px;
  font-family: var(--font);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.panel .hint { color: var(--muted); font-size: 13px; margin: 0 0 12px; }

.volante-wrap {
  display: grid;
  justify-items: center;
  margin-bottom: 4px;
}

.volante {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  width: min(320px, 100%);
  max-width: 100%;
  background: var(--ticket);
  padding: 12px;
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(122, 36, 143, 0.08);
}

.volante button {
  aspect-ratio: 1;
  border-radius: 8px;
  border: 1px solid #e4d48a;
  background: #fff;
  color: var(--ticket-ink);
  font-weight: 700;
  font-size: 15px;
  min-width: 0;
  padding: 0;
}

.volante button[aria-pressed="true"] {
  background: var(--ticket-ink);
  color: #fff;
  border-color: var(--ticket-ink);
}

.volante-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: min(320px, 100%);
  margin: 10px 0 12px;
  color: var(--muted);
  font-size: 13px;
  gap: 8px;
}

.row-btns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

details.faq {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 4px 16px;
  margin-top: 10px;
}

details.faq summary {
  cursor: pointer;
  padding: 12px 0;
  font-weight: 600;
}

details.faq p, details.faq li {
  color: var(--muted);
  font-size: 14px;
}

details.faq.advanced {
  margin-top: 12px;
  background: var(--bg-2);
}

details.faq.advanced .row-btns {
  margin: 0 0 12px;
}

.disclaimer {
  color: #8a7a96;
  font-size: 12px;
  margin-top: 22px;
  padding: 0 6px;
}

.file-btn {
  position: relative;
  overflow: hidden;
}

.file-btn input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--ticket-ink);
  color: #fff;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 20;
}

.toast.show { opacity: 1; }

.top-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.btn-account,
.btn-pro {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 999px;
  min-height: 40px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--cream);
}

.btn-pro {
  background: var(--ticket-ink);
  color: #fff;
  border-color: var(--ticket-ink);
}

.account {
  display: flex;
  align-items: center;
  gap: 8px;
}

.account-email {
  font-size: 12px;
  color: var(--muted);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: calc(100% - 24px);
}
.sheet::backdrop {
  background: rgba(36, 21, 46, 0.38);
}
.sheet-card {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 20px;
  box-shadow: var(--shadow);
  color: var(--cream);
}
.sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.sheet-head h2 {
  margin: 0;
  font-family: var(--font);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.sheet-x {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 28px;
  line-height: 1;
  min-height: 36px;
  padding: 0 6px;
}
.field {
  display: grid;
  gap: 6px;
  margin: 12px 0;
  font-size: 13px;
  color: var(--muted);
}
.field input {
  width: 100%;
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  padding: 0 12px;
  color: var(--cream);
}
.auth-err {
  color: var(--rose);
  font-size: 13px;
  margin: 0 0 10px;
}
.sheet-switch {
  text-align: center;
  margin: 12px 0 0;
}
.pay-list {
  margin: 8px 0 14px;
  padding-left: 18px;
  color: var(--cream);
  font-size: 14px;
}
.pay-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--ticket-ink);
  margin: 0 0 8px;
}
body.mode-demo .full-only,
body.mode-full .demo-only {
  display: none !important;
}

.demo-badge {
  margin: 6px 0 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ticket-ink);
}

.demo-note {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.prompt-box {
  max-height: 240px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  line-height: 1.45;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  color: var(--cream);
  margin: 0 0 12px;
}

a.btn {
  display: grid;
  place-items: center;
  text-decoration: none;
}

body.mode-demo #conferir-row {
  grid-template-columns: 1fr;
}

@media (max-width: 560px) {
  .hero { padding: 18px 14px 16px; border-radius: 18px; }
  .brand h1 { font-size: 22px; }
  .mark { width: 42px; height: 42px; font-size: 18px; border-radius: 10px; }
  .pill-meta { padding: 6px 10px; }
  .pill-meta strong { font-size: 16px; }
  .qty button { font-size: 13px; min-height: 44px; }
  .switch { padding: 10px 12px; }
  .switch small { font-size: 11px; }
  .row-btns { gap: 8px; }
  .btn { letter-spacing: 0; }
  .game-head { align-items: flex-start; }
  .account-email { display: none; }
  .top-right { flex-wrap: wrap; justify-content: flex-end; }
  .ball { width: 30px; height: 30px; font-size: 12px; }
  .ultimo-bolas { gap: 5px; }
  .hero .lede { font-size: 14px; }
}

@media (min-width: 560px) {
  .mini-volante { display: grid; }
  .ticket {
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 16px;
  }
}

@media (min-width: 720px) {
  .wrap {
    max-width: 720px;
    padding: 32px 20px calc(72px + env(safe-area-inset-bottom, 0px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .game { animation: none; }
  .knob::after { transition: none; }
}
