/* Validador Dia de Sorte
   Layout padronizado (split-screen) inspirado na Lotomania */
:root {
  height: auto;
  min-height: 100%;
}

body.validator-page--diadesorte {
  height: auto;
  min-height: 100vh;
}

/* Layout padrão: seletor centralizado antes de validar */
.dv-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  max-width: 680px;
  transition: max-width 0.4s ease-in-out;
  margin: 0 auto;
  padding: 16px 16px 50px;
}

/* Após validar: layout 2 colunas (40% seletor / 60% resultados) */
.dv-layout--active {
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  max-width: 1400px;
}

/* Estado inicial: oculta seção de resultados antes de validar */
.dv-layout:not(.dv-layout--active) .dv-results {
  display: none;
}

/* Cabeçalho e loading sempre ocupam todas as colunas */
.dv-layout > .dv-header,
.dv-layout > .dv-loading {
  grid-column: 1 / -1;
  padding: 24px 0 8px;
}

.dv-header h1 {
    font-size: 33px;
    max-width: 380px;
    color: #2c3e50;
    margin-bottom: 6px;
}

.dv-header p {
  font-size: 14px;
  color: #7f8c8d;
  margin: 0;
}

/* Coluna esquerda: seletor */
.dv-selector {
  background: #fff;
  border-radius: 12px;
  padding: 20px 20px 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

.dv-selector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.dv-selector-header h2 {
  color: #2c3e50;
  margin: 0;
  font-size: 20px;
}

.dv-counter {
  background: #ccb225;
  color: #fff;
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
}

/* Grid de números: 7 colunas constantes (estilo calendário) */
.dv-numbers-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(32px, 46px));
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
}

.dv-num-btn {
  aspect-ratio: 1;
  border: 2px solid #bdc3c7;
  background: #fff;
  border-radius: 50%;
  font-size: 15px;
  font-weight: 700;
  color: #2c3e50;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, border-color .15s, transform .1s;
  padding: 0;
  width: 100%;
  max-width: 46px;
  max-height: 46px;
  height: auto;
  margin-bottom: 0;
  touch-action: manipulation;
}

@media (hover: hover) {
  .dv-num-btn:hover {
    border-color: #ccb225;
    background: #fdfaf0;
    transform: scale(1.08);
  }
}

.dv-num-btn.selected {
  background: #ccb225;
  border-color: #ccb225;
  color: #fff;
  transform: scale(1.05);
}

/* Mês da Sorte */
.dv-lucky-month-wrapper {
  margin-bottom: 20px;
  text-align: center;
}
.dv-lucky-month-wrapper label {
  display: block;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 8px;
}
.dv-select {
  padding: 8px 12px;
  border: 2px solid #bdc3c7;
  border-radius: 6px;
  font-size: 15px;
  color: #2c3e50;
  background: #fff;
  cursor: pointer;
  min-height: 44px;
  touch-action: manipulation;
}
.dv-select:focus {
  border-color: #ccb225;
  outline: none;
}

/* Ações */
.dv-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 4px;
}

.dv-btn {
  padding: 10px 22px;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
  width: auto;
  height: auto;
  max-height: none;
  margin-bottom: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  touch-action: manipulation;
}

.dv-btn-primary { background: #27ae60; color: #fff; }
.dv-btn-primary:hover:not(:disabled) { background: #229954; }
.dv-btn-primary:disabled { background: #95a5a6; cursor: not-allowed; }

.dv-btn-secondary { background: #e74c3c; color: #fff; }
.dv-btn-secondary:hover { background: #c0392b; }

.dv-btn-blue { background: #1976d2; color: #fff; }
.dv-btn-blue:hover { background: #1565c0; }

.dv-btn-sm { font-size: 12px; padding: 4px 10px; border-radius: 5px; }

/* Coluna direita: resultados */
.dv-results {
  background: #fff;
  border-radius: 12px;
  padding: 20px 20px 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

.dv-placeholder {
  text-align: center;
  color: #7f8c8d;
  padding: 32px 16px;
  border: 1px dashed #ddd;
  border-radius: 10px;
}

/* Cabeçalho dos resultados */
.dv-results-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.dv-expand-btn {
  flex-shrink: 0;
  align-self: flex-start;
}

.dv-numbers-display {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  border: 1px solid #eee;
  border-radius: 8px;
  background: #fafafa;
  margin-bottom: 8px;
}

.dv-number-chip {
  background: #ccb225;
  color: #fff;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 13px;
}

.dv-lucky-month-display {
  padding: 8px;
  background: #fdfaf0;
  border: 1px solid #eee;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dv-month-chip {
  background: #c2185b;
  color: #fff;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 13px;
}

/* Cards de resumo */
.dv-summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.dv-summary-card {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 16px;
  border-left: 4px solid #ccb225;
}

.dv-summary-card h3 {
  color: #2c3e50;
  margin: 0 0 12px;
  font-size: 15px;
  text-align: center;
}

.dv-stats { display: flex; flex-direction: column; gap: 8px; }

.dv-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid #ecf0f1;
  font-size: 14px;
}

.dv-stat:last-child { border-bottom: none; }
.dv-stat-label { font-weight: 600; color: #34495e; }
.dv-stat-value { color: #27ae60; font-weight: 700; }

/* Distribuição de acertos */
.dv-hits-dist {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border: 1px solid #eee;
  border-radius: 8px;
}

.dv-hit-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.dv-hit-badge {
  background: #27ae60;
  color: #fff;
  padding: 3px 10px;
  border-radius: 10px;
  font-weight: 700;
  min-width: 28px;
  text-align: center;
}

/* Filtros */
.dv-filters-section { margin-top: 24px; }

.dv-filters-section h3 {
  color: #2c3e50;
  margin: 0 0 16px;
  font-size: 16px;
  text-align: center;
}

.dv-filter-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.dv-filter-controls label {
  font-size: 13px;
  font-weight: 600;
  color: #2c3e50;
}

.dv-input {
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 13px;
  background: #fff;
  width: auto;
  height: auto;
  margin: 0;
  min-height: 44px;
  touch-action: manipulation;
}

/* Lista de concursos: scroll interno */
.dv-contests-list {
  max-height: 600px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #ddd transparent;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 4px;
}

.dv-contests-list::-webkit-scrollbar { width: 6px; }
.dv-contests-list::-webkit-scrollbar-thumb { background: #ddd; border-radius: 6px; }

.dv-contest-item {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 16px;
  border-left: 4px solid #ccb225;
}

.dv-contest-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.dv-contest-info { display: flex; flex-direction: column; gap: 2px; }
.dv-contest-num { font-weight: 700; color: #2c3e50; }
.dv-contest-date { color: #7f8c8d; font-size: 12px; }

.dv-hits-label {
  padding: 5px 12px;
  border-radius: 14px;
  font-weight: 700;
  color: #fff;
  font-size: 13px;
}

.dv-hits-label.high   { background: #27ae60; }
.dv-hits-label.medium { background: #f39c12; }
.dv-hits-label.low    { background: #e74c3c; }

.dv-drawn-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}

.dv-ball {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: #fff;
}

.dv-ball.hit    { background: #27ae60; }
.dv-ball.missed { background: #e74c3c; }

.dv-contest-details { display: flex; flex-direction: column; gap: 6px; }

.dv-detail {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
}

.dv-detail-label { font-weight: 600; color: #2c3e50; white-space: nowrap; }
.dv-detail-value { color: #34495e; text-align: right; }
.dv-detail-value.lucky-hit { color: #27ae60; font-weight: bold; }
.dv-detail-value.lucky-missed { color: #e74c3c; font-weight: bold; }

/* Loading */
.dv-loading {
  display: none;
  text-align: center;
  padding: 40px;
  grid-column: 1 / -1;
}

.dv-spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #ccb225;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: dv-spin 1s linear infinite;
  margin: 0 auto 16px;
}

@keyframes dv-spin {
  to { transform: rotate(360deg); }
}

/* Modo expandido */
.dv-layout--active.full-view {
  grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
  max-width: 1400px;
}

/* Título de resultados sr-only */
.dv-results-title-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.dv-layout--active .dv-results-title-sr {
  position: static;
  width: auto;
  height: auto;
  padding: 0;
  margin: 0 0 12px;
  overflow: visible;
  clip: auto;
  white-space: normal;
  color: #2c3e50;
  font-size: 22px;
}

.dv-results:not(.dv-results--active) .dv-results-header { display: none; }

/* Responsivo */
@media (max-width: 1100px) {
  .dv-layout--active,
  .dv-layout--active.full-view {
    grid-template-columns: 1fr;
    max-width: 700px;
  }
  #dv-toggle-view { display: none; }
}

@media (max-width: 600px) {
  .dv-selector {
    padding: 16px 12px 12px;
  }

  .dv-numbers-grid {
    gap: 6px;
  }

  .dv-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 400px) {
  .dv-selector {
    padding: 12px 8px 10px;
  }

  .dv-numbers-grid {
    gap: 4px;
  }

  .dv-layout { padding: 8px 8px 0; }
}