/* ==========================================================
   Mais Matemática — Loterias (layout geral + probabilidade)
   Tudo isolado dentro de #mm-loto-app2
   ========================================================== */

#mm-loto-app2 {
  --gold: #c9a54a;
  --blue: #1e293b;
  --blue-light: #2563eb;
  --bg: #eef2f4;
  --card: #ffffff;
  --muted: #64748b;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
}

/* Wrapper geral */
#mm-loto-app2 .wrap {
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 16px 32px;
}

/* Cards */
#mm-loto-app2 .card {
  background: var(--card);
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  padding: 16px 20px;
}

/* Topbar: seletor + como jogar */
#mm-loto-app2 .topbar {
  display: grid;
  grid-template-columns: minmax(0, 260px) minmax(0, 1.2fr) minmax(0, 140px);
  gap: 12px;
  margin-bottom: 18px;
}

#mm-loto-app2 label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  color: #0f172a;
}

#mm-loto-app2 select,
#mm-loto-app2 input[type="number"],
#mm-loto-app2 input[type="text"] {
  width: 100%;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid #d0d7e2;
  font-size: 14px;
  box-sizing: border-box;
}

#mm-loto-app2 select:focus,
#mm-loto-app2 input[type="number"]:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.25);
}

/* Texto "como jogar" e nome da loteria */
#mm-loto-app2 .note {
  font-size: 13px;
  color: var(--muted);
}

#mm-loto-app2 .howto {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  padding: 10px;
  border-radius: 10px;
  line-height: 1.45;
}

#mm-loto-app2 .lotoname {
  text-align: center;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 13px;
  color: #2563eb;
}

/* Layout principal: barra lateral + painel */
#mm-loto-app2 .layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 16px;
}

/* Barra lateral */
#mm-loto-app2 .side {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#mm-loto-app2 .nav {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  background: #e2e8f0;
  color: #0f172a;
  text-align: left;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.05s ease;
}

#mm-loto-app2 .nav:hover {
  background: #dbeafe;
  transform: translateY(-1px);
}

#mm-loto-app2 .nav.active {
  background: var(--gold);
  color: #000;
  border-color: #b98d27;
}

/* Títulos dentro do painel */
#mm-loto-app2 h2 {
  font-size: 22px;
  font-weight: 800;
  margin: 4px 0 12px;
  color: #0f172a;
}

#mm-loto-app2 h3 {
  font-size: 17px;
  font-weight: 700;
  margin: 18px 0 8px;
  color: #0f172a;
}

/* Texto introdutório */
#mm-loto-app2 .mm-intro {
  margin: 0 0 10px;
  line-height: 1.5;
}

#mm-loto-app2 .mm-intro span {
  font-weight: 700;
}

/* Linha de inputs k, n, m (3 blocos) */
#mm-loto-app2 .mm-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 180px));
  gap: 10px 16px;
  align-items: end;
  margin: 6px 0 8px;
}

#mm-loto-app2 .mm-row > div label {
  margin-bottom: 3px;
}

/* Botões CALCULAR / LIMPAR */
#mm-loto-app2 .mm-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 4px 0 14px;
}

#mm-loto-app2 .btn {
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 700;
  border: 0;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.05s ease, box-shadow 0.18s ease;
}

#mm-loto-app2 .btn.primary {
  background: #1d4ed8;
  color: #ffffff;
  box-shadow: 0 3px 7px rgba(37, 99, 235, 0.4);
}

#mm-loto-app2 .btn.primary:hover {
  background: #1e40af;
  transform: translateY(-1px);
}

#mm-loto-app2 .btn.light {
  background: #e2e8f0;
  color: #0f172a;
  border: 1px solid #cbd5e1;
}

#mm-loto-app2 .btn.light:hover {
  background: #e5e7eb;
}

/* Tabela de resultados */
#mm-loto-app2 .mm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

#mm-loto-app2 .mm-table thead th {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  font-weight: 700;
}

#mm-loto-app2 .mm-table tbody td {
  padding: 8px 10px;
  border-bottom: 1px solid #e5e7eb;
}

#mm-loto-app2 .mm-table tbody tr:nth-child(even) {
  background: #f9fafb;
}

/* Observação e resumo */
#mm-loto-app2 .mm-obs {
  margin-top: 10px;
}

#mm-loto-app2 .mm-resumo {
  margin-top: 8px;
}

/* Bloco de fórmulas (quando usado) */
#mm-loto-app2 .mm-formulas {
  background: #f8fafc;
  border-radius: 12px;
  padding: 10px 14px;
  margin-top: 4px;
}

/* Footer note */
#mm-loto-app2 .footer-note {
  text-align: center;
  margin-top: 14px;
}

/* Responsividade */
@media (max-width: 900px) {
  #mm-loto-app2 .topbar {
    grid-template-columns: minmax(0, 1fr);
  }

  #mm-loto-app2 .layout {
    grid-template-columns: minmax(0, 1fr);
  }

  #mm-loto-app2 .side {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
  }

  #mm-loto-app2 .nav {
    flex: 1 1 45%;
    text-align: center;
  }

  #mm-loto-app2 .mm-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  #mm-loto-app2 .mm-row {
    grid-template-columns: minmax(0, 1fr);
  }

  #mm-loto-app2 .mm-buttons {
    flex-direction: column;
  }

  #mm-loto-app2 .nav {
    flex: 1 1 100%;
  }
}

#mm-loto-app2 .mm-result-title {
  margin-top: 22px;   /* dá um bom respiro dos botões */
}

/* ==========================
   Overlay "Aguarde..." (Estatística)
   ========================== */

/* o card da estatística usa id="mm-card" dentro do mm2-panel */
#mm-card {
  position: relative;
}

.mm-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.85);
  z-index: 10;
}

.mm-loading-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  background: #111827;
  color: #f9fafb;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.35);
}

.mm-loading-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 2px solid #9ca3af;
  border-top-color: #c9a54a; /* dourado do site */
  animation: mmspin 0.8s linear infinite;
}

.mm-loading-text {
  font-size: 0.95rem;
  font-weight: 600;
}

@keyframes mmspin {
  to {
    transform: rotate(360deg);
  }
}