.lotto-header p {
  margin-top: 0.5rem;
  color: rgba(226, 232, 240, 0.85);
}

.lotto-header {
  padding: 2rem 1.5rem 1.25rem;
}

.lotto-main {
  max-width: 960px;
  margin: 0 auto;
  padding-bottom: 4rem;
}

.lotto-meta {
  font-size: 0.95rem;
  color: rgba(226, 232, 240, 0.85);
  margin-bottom: 1rem;
}

.lotto-combo-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.lotto-combo-row {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 1.2rem;
  padding: 0.9rem 1.2rem;
  border-radius: 18px;
  background: linear-gradient(150deg, rgba(15, 23, 42, 0.9), rgba(17, 24, 39, 0.76));
  border: 1px solid rgba(94, 234, 212, 0.18);
  box-shadow: 0 18px 30px -24px rgba(59, 130, 246, 0.5);
}

.lotto-combo-header {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: rgba(226, 232, 240, 0.85);
  min-width: 70px;
  text-align: left;
}

.lotto-combo-numbers {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  flex-wrap: nowrap;
  width: 100%;
}

.lotto-number-list {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.lotto-history {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.lotto-history-entry {
  border: none;
  border-radius: 0;
  padding: 1rem 1.25rem;
  background-color: rgba(15, 23, 42, 0.6);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.lotto-history-meta {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: rgba(226, 232, 240, 0.8);
}

.lotto-history-combos {
  display: grid;
  gap: 0.9rem;
}

.lotto-history-combo {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.2rem;
  border-radius: 18px;
  background: linear-gradient(150deg, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.7));
  border: 1px solid rgba(94, 234, 212, 0.16);
}

.lotto-history-label {
  font-size: 0.85rem;
  color: rgba(226, 232, 240, 0.75);
}

.lotto-history-combo .lotto-number-list {
  flex-wrap: nowrap;
  justify-content: flex-start;
  gap: 1rem;
}

.lotto-history-result {
  text-align: right;
  min-width: 120px;
  font-size: 0.9rem;
  color: rgba(148, 163, 184, 0.9);
}

.lotto-history-result strong {
  color: #facc15;
  display: block;
  font-size: 1rem;
}

.lotto-history-actual {
  font-size: 0.92rem;
  font-weight: 600;
  color: rgba(226, 232, 240, 0.92);
}

.lotto-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  font-weight: 700;
  font-size: 1.02rem;
  color: #ffffff;
  box-shadow: 0 12px 18px -12px rgba(15, 23, 42, 0.7);
  border: 2px solid rgba(255, 255, 255, 0.7);
}

.lotto-number-yellow {
  background: linear-gradient(150deg, #facc15, #f59e0b);
}

.lotto-number-blue {
  background: linear-gradient(150deg, #38bdf8, #2563eb);
}

.lotto-number-red {
  background: linear-gradient(150deg, #ef4444, #b91c1c);
}

.lotto-number-black {
  background: linear-gradient(150deg, #0f172a, #1f2937);
}

.lotto-number-green {
  background: linear-gradient(150deg, #22c55e, #15803d);
}

.lotto-number-powerball {
  background: linear-gradient(150deg, #f97316, #ea580c);
  border-color: rgba(255, 255, 255, 0.9);
}

@media (max-width: 600px) {
  .lotto-main {
    padding-bottom: 3rem;
  }

  .lotto-combo-grid {
    gap: 0.75rem;
  }

  .lotto-combo-row {
    grid-template-columns: 1fr;
    justify-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0.9rem;
  }

  .lotto-combo-header {
    font-size: 0.85rem;
    text-align: left;
  }

  .lotto-combo-numbers {
    --combo-gap: 0.35rem;
    justify-content: flex-start;
    gap: var(--combo-gap);
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.1rem;
  }

  .lotto-combo-numbers::-webkit-scrollbar {
    display: none;
  }

  .lotto-number-list {
    gap: var(--combo-gap);
    flex-wrap: nowrap;
  }

  .lotto-history-combo {
    grid-template-columns: 1fr;
    justify-items: flex-start;
    gap: 0.8rem;
  }

  .lotto-history-combo .lotto-number-list {
    flex-wrap: nowrap;
    gap: 0.45rem;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.1rem;
  }

  .lotto-history-combo .lotto-number-list::-webkit-scrollbar {
    display: none;
  }

  .lotto-history-result {
    text-align: left;
    min-width: auto;
  }

  .lotto-number {
    flex: 0 1 auto;
    width: clamp(30px, calc((100% - 5 * var(--combo-gap, 0.35rem)) / 6), 36px);
    height: clamp(30px, calc((100% - 5 * var(--combo-gap, 0.35rem)) / 6), 36px);
    font-size: 0.78rem;
  }

  .draws-number-cell {
    min-width: 0;
  }

  .draws-number-list {
    justify-content: center;
    flex-wrap: nowrap;
  }
}

.analysis-main {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  padding: 0 1.5rem 4rem;
}

.analysis-section {
  background: rgba(15, 23, 42, 0.58);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 18px;
  padding: 1.75rem 1.9rem;
  box-shadow: 0 20px 36px -32px rgba(59, 130, 246, 0.45);
}

.analysis-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.analysis-heading h2 {
  margin: 0;
  font-size: 1.25rem;
  color: #f1f5f9;
}

.analysis-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  font-size: 0.88rem;
  color: rgba(226, 232, 240, 0.82);
}

.analysis-description {
  margin-bottom: 1rem;
  color: rgba(226, 232, 240, 0.75);
  font-size: 0.92rem;
}

.table-wrapper {
  width: 100%;
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.65);
}

.stats-table-wrapper {
  max-height: 460px;
  overflow-y: auto;
}

.lotto-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 100%;
}

.lotto-table th,
.lotto-table td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  font-size: 0.9rem;
  color: rgba(226, 232, 240, 0.9);
}

.lotto-table th {
  font-size: 0.95rem;
  font-weight: 600;
  color: rgba(226, 232, 240, 0.95);
  background: rgba(15, 23, 42, 0.6);
  position: sticky;
  top: 0;
  z-index: 1;
}

.lotto-table tbody tr:hover {
  background: rgba(30, 41, 59, 0.5);
}

.table-sort-button {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0;
}

.table-sort-button:hover,
.table-sort-button:focus-visible {
  color: #facc15;
  outline: none;
}

.table-sort-button .table-sort-button-label {
  white-space: nowrap;
}

.lotto-table-number {
  text-align: center;
}

.lotto-number.lotto-table-ball {
  width: 42px;
  height: 42px;
  font-size: 0.9rem;
}

.lotto-number.lotto-range-ball {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.75rem;
  min-width: 52px;
  height: 42px;
  font-size: 0.85rem;
  border-radius: 999px;
}

.draws-main {
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.draws-number-cell {
  min-width: 260px;
}

.draws-number-list {
  gap: 0.55rem;
  justify-content: center;
}

.draws-actions {
  display: flex;
  justify-content: center;
  margin-top: 0.9rem;
}

.draws-load-button {
  padding: 0.65rem 1.1rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(30, 41, 59, 0.8);
  color: rgba(226, 232, 240, 0.9);
  cursor: pointer;
  font-size: 0.92rem;
  transition: background 0.2s ease, transform 0.2s ease;
}

.draws-load-button:hover,
.draws-load-button:focus-visible {
  background: rgba(59, 130, 246, 0.32);
  transform: translateY(-1px);
  outline: none;
}

.draws-load-button.hidden {
  display: none;
}

.analysis-section + .analysis-section {
  margin-top: 1.5rem;
}

@media (max-width: 768px) {
  .analysis-section {
    padding: 1.4rem 1.25rem;
  }

  .analysis-heading {
    flex-direction: column;
    align-items: flex-start;
  }

  .table-wrapper {
    border-radius: 12px;
  }

  .lotto-table th,
  .lotto-table td {
    padding: 0.55rem 0.6rem;
    font-size: 0.82rem;
  }

  .lotto-number.lotto-table-ball {
    width: 36px;
    height: 36px;
    font-size: 0.78rem;
  }

  .lotto-number.lotto-range-ball {
    min-width: 46px;
    height: 36px;
    font-size: 0.76rem;
  }

  .draws-main {
    padding: 0 1.1rem 3rem;
  }
}

@media (max-width: 640px) {
  .draws-main .table-wrapper {
    overflow-x: visible;
  }

  .draws-main .table-wrapper table {
    min-width: 100%;
  }

  .draws-main .lotto-table thead {
    display: none;
  }

  .draws-main .lotto-table,
  .draws-main .lotto-table tbody,
  .draws-main .lotto-table tr,
  .draws-main .lotto-table td {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }

  .draws-main .lotto-table tr {
    margin-bottom: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 14px;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.78);
    box-shadow: 0 12px 18px -18px rgba(59, 130, 246, 0.45);
  }

  .draws-main .lotto-table tr:last-child {
    margin-bottom: 0;
  }

  .draws-main .lotto-table td {
    padding: 0.65rem 0.95rem;
    border: none;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    width: 100%;
    min-width: 100%;
  }

  .draws-main .lotto-table td:last-child {
    border-bottom: none;
  }

  .draws-main .lotto-table td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.78rem;
    color: rgba(148, 163, 184, 0.78);
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

  .draws-main .draws-number-cell {
    padding: 0.6rem 0.95rem;
    min-width: auto;
  }

  .draws-main .draws-number-list {
    justify-content: space-between;
    flex-wrap: nowrap;
    width: 100%;
    gap: clamp(0.25rem, 3vw, 0.35rem);
  }

  .draws-main .draws-number-list .lotto-number {
    width: clamp(30px, 8vw, 34px);
    height: clamp(30px, 8vw, 34px);
    font-size: clamp(0.68rem, 2.2vw, 0.76rem);
  }

  .draws-main .draws-number-list .lotto-number.lotto-number-powerball {
    font-size: clamp(0.7rem, 2.3vw, 0.78rem);
  }

  .draws-main {
    padding: 0 0.85rem 2.5rem;
  }
}

@media (max-width: 480px) {
  .draws-main .lotto-table td {
    padding: 0.55rem 0.85rem;
    font-size: 0.86rem;
  }

  .draws-main .lotto-table td::before {
    font-size: 0.72rem;
  }

  .draws-main .draws-number-list {
    gap: clamp(0.2rem, 3vw, 0.28rem);
  }

  .draws-main .draws-number-list .lotto-number {
    width: clamp(28px, 9vw, 32px);
    height: clamp(28px, 9vw, 32px);
    font-size: clamp(0.62rem, 2.5vw, 0.72rem);
  }
}
