:root {
  --bg: #0f1419;
  --card: #1a2332;
  --border: #2d3a4f;
  --text: #e8edf4;
  --muted: #8b9cb3;
  --gold: #f5c518;
  --star: #5eb3ff;
  --accent: #3dd68c;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

header {
  text-align: center;
  padding: 2rem 1rem 1rem;
  border-bottom: 1px solid var(--border);
}

header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.tagline { color: var(--muted); font-size: 0.9rem; margin-top: 0.25rem; }

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
}

.upload-section .hint { margin-bottom: 0.75rem; }

.excel-drop {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 1.25rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.excel-drop:hover,
.excel-drop:focus-visible {
  border-color: var(--accent);
  background: rgba(61, 214, 140, 0.06);
  outline: none;
}

.excel-drop.dragover {
  border-color: var(--gold);
  background: rgba(245, 197, 24, 0.08);
}

.excel-drop.disabled {
  opacity: 0.55;
  pointer-events: none;
  cursor: wait;
}

.excel-drop-title { font-size: 0.95rem; margin-bottom: 0.35rem; }
.excel-drop-sub { font-size: 0.8rem; color: var(--muted); }
.excel-drop-meta { font-size: 0.75rem; color: var(--muted); margin-top: 0.65rem; }

.card h2 {
  font-size: 1rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
}

.combo { display: flex; align-items: center; flex-wrap: wrap; gap: 0.35rem; }
.combo.big { margin: 0.5rem 0; }
.sep { color: var(--muted); margin: 0 0.25rem; }

.balls { display: flex; gap: 0.35rem; flex-wrap: wrap; }

.ball {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.95rem;
}

.ball.num { background: var(--gold); color: #1a1200; }
.ball.star { background: var(--star); color: #0a1628; font-size: 0.85rem; }
.combo.big .ball { width: 2.75rem; height: 2.75rem; font-size: 1.1rem; }

.date { font-size: 0.85rem; color: var(--muted); }
.meta { font-size: 0.8rem; color: var(--muted); margin-top: 0.5rem; }
.pool-meta { margin-bottom: 0.75rem; }

.recent-draw {
  border-top: 1px solid var(--border);
  padding-top: 0.85rem;
  margin-top: 0.85rem;
}

.recent-draw:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.recent-latest .date { color: var(--accent); font-weight: 600; }

.recent-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
  margin-top: 0.5rem;
  font-size: 0.78rem;
}

.recent-stats dt { color: var(--muted); font-size: 0.7rem; }
.recent-stats dd { font-weight: 600; }
.recent-stats .band { color: var(--muted); font-weight: 400; font-size: 0.7rem; }

.pick-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.pick-header h2 { margin-bottom: 0; }

.tabs { display: flex; gap: 0.35rem; }

.tab {
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  background: var(--bg);
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  border: 1px solid var(--border);
}

.tab.active { background: var(--accent); color: #0a1a12; border-color: var(--accent); font-weight: 600; }

.boleto {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.boleto.featured { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(61, 214, 140, 0.2); }

.boleto-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.35rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 0.75rem;
  font-size: 0.8rem;
}

.stats dt { color: var(--muted); }
.stats dd { font-weight: 600; }

.hint { font-size: 0.85rem; color: var(--muted); margin: 0.5rem 0; }

.filter-form fieldset {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
}

.filter-form legend {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  padding: 0 0.35rem;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr));
  gap: 0.4rem;
}

.desv-grid { grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr)); }

.check-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  background: var(--bg);
  cursor: pointer;
  font-size: 0.85rem;
}

.check-item:has(input:checked) {
  background: rgba(61, 214, 140, 0.12);
  outline: 1px solid rgba(61, 214, 140, 0.35);
}

.check-item input { accent-color: var(--accent); }

.check-label em { color: var(--muted); font-style: normal; font-size: 0.75rem; }

.empty {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 1rem 0;
  text-align: center;
}

.btn-secondary {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.btn-secondary:hover { filter: none; color: var(--text); border-color: var(--muted); }

.btn {
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: var(--gold);
  color: #1a1200;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
}

.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: 0.6; cursor: wait; }

.status { font-size: 0.85rem; color: var(--muted); text-align: center; margin-top: 0.5rem; min-height: 1.2em; }

.progress-panel {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.progress-panel.progress-fixed {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  margin: 0;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
  border-radius: 12px 12px 0 0;
  border-bottom: none;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.45);
}

body.progress-active {
  padding-bottom: 5.5rem;
}

.progress-panel.hidden { display: none; }

.progress-label {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: var(--text);
}

.progress-track {
  height: 12px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  border-radius: 6px;
  transition: width 0.25s ease;
}

.progress-pct {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
  text-align: right;
}

.btn-stop {
  display: block;
  width: 100%;
  margin-top: 0.65rem;
  padding: 0.45rem 0.75rem;
  background: transparent;
  color: #ff8a8a;
  border: 1px solid rgba(255, 138, 138, 0.45);
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-stop:hover { background: rgba(255, 138, 138, 0.1); }
.btn-stop.hidden { display: none; }

.tabs a[aria-disabled="true"] {
  pointer-events: none;
  opacity: 0.5;
}

.filters ul { list-style: none; font-size: 0.85rem; }
.filters li { padding: 0.25rem 0; color: var(--muted); }
.filters li strong { color: var(--text); }

.disclaimer {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--muted);
  font-style: italic;
}

footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
}

footer a { color: var(--star); }

@media (max-width: 480px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .recent-stats { grid-template-columns: repeat(2, 1fr); }
}
