:root {
  --lab-ui-bg: #0b1020;
  --lab-ui-panel: rgba(18, 26, 47, 0.92);
  --lab-ui-panel-soft: rgba(23, 33, 58, 0.9);
  --lab-ui-line: rgba(255, 255, 255, 0.12);
  --lab-ui-text: #f5f7fb;
  --lab-ui-muted: #c7d0df;
  --lab-ui-muted-soft: #9aa7bd;
  --lab-ui-blue: #4ea1ff;
  --lab-ui-green: #46d39a;
  --lab-ui-gold: #ffd166;
  --lab-ui-red: #ff6b4a;
  --lab-ui-radius: 8px;
  --lab-ui-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
}

body {
  background:
    radial-gradient(circle at 12% 0%, rgba(78, 161, 255, 0.16), transparent 32rem),
    radial-gradient(circle at 88% 4%, rgba(70, 211, 154, 0.12), transparent 28rem),
    var(--lab-ui-bg);
  overflow-x: hidden;
}

a,
button,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
.primary-button,
.ghost-button,
.control-button,
.header-link {
  min-height: 44px;
}

input[type="number"],
input[type="text"],
select,
textarea {
  border-radius: var(--lab-ui-radius);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(78, 161, 255, 0.68);
  outline-offset: 3px;
}

.site-header {
  background: rgba(11, 16, 32, 0.9);
  border-bottom-color: var(--lab-ui-line);
  backdrop-filter: blur(14px);
}

.site-nav {
  gap: 14px;
}

.brand {
  min-height: 44px;
}

.header-links {
  gap: 8px;
}

.header-link {
  border: 1px solid transparent;
  border-radius: 999px;
  white-space: nowrap;
}

.header-link:hover,
.header-link:focus-visible {
  border-color: rgba(78, 161, 255, 0.25);
}

.card,
.panel,
.hero-panel,
.intro-card,
.seo-card,
.tool-card,
.featured-card,
.ticket-card,
.table-panel,
.controls,
.data-status,
.draw-readout,
.filter-control,
.speed-control,
.main-panel,
.details-panel > section {
  border-radius: var(--lab-ui-radius);
}

.card,
.panel,
.hero-panel,
.intro-card,
.seo-card,
.tool-card,
.featured-card,
.ticket-card,
.table-panel {
  box-shadow: var(--lab-ui-shadow);
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
}

h1,
h2,
h3,
.hero-panel strong,
.card strong,
.panel strong {
  overflow-wrap: anywhere;
}

.ticket-balls,
.selected-balls {
  align-items: center;
}

.ticket-ball,
.selected-ball,
.number-pill,
.number-cell {
  flex: 0 0 auto;
}

.lab-shell {
  color: var(--lab-ui-text);
}

.lab-shell .intro,
.lab-shell .panel-heading p,
.lab-shell .detail-list dt,
.lab-shell .frequency-group h3,
.lab-shell .frequency-rank,
.lab-shell .data-source {
  color: var(--lab-ui-muted);
}

.lab-shell .data-status,
.lab-shell .controls,
.lab-shell .speed-control,
.lab-shell .draw-readout,
.lab-shell .filter-control,
.lab-shell .main-panel,
.lab-shell .details-panel > section,
.lab-shell .data-source {
  background: var(--lab-ui-panel);
  border-color: var(--lab-ui-line);
  color: var(--lab-ui-text);
  box-shadow: var(--lab-ui-shadow);
}

.lab-shell .data-status span,
.lab-shell .draw-readout span,
.lab-shell .speed-control span,
.lab-shell .filter-control span {
  color: var(--lab-ui-muted-soft);
}

.lab-shell .play-toggle {
  background: linear-gradient(135deg, var(--lab-ui-blue), var(--lab-ui-green));
  color: #06101f;
}

.lab-shell .play-toggle:hover,
.lab-shell .play-toggle:focus-visible {
  background: linear-gradient(135deg, #6bb3ff, #5ee0aa);
}

.lab-shell .control-button,
.lab-shell .filter-control select,
.lab-shell .speed-control output,
.lab-shell .detail-list dd,
.lab-shell .frequency-count {
  color: var(--lab-ui-text);
}

.lab-shell .control-button,
.lab-shell .detail-list div,
.lab-shell .frequency-list li {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--lab-ui-line);
}

.lab-shell .control-button:hover,
.lab-shell .control-button:focus-visible {
  border-color: rgba(70, 211, 154, 0.45);
  background: rgba(70, 211, 154, 0.12);
}

.lab-shell .number-cell {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--lab-ui-line);
  color: var(--lab-ui-muted);
}

.lab-shell .main-cell.is-hit {
  background: var(--lab-ui-blue);
  border-color: var(--lab-ui-blue);
  color: #06101f;
}

.lab-shell .powerball-cell {
  background: rgba(255, 107, 74, 0.1);
}

.lab-shell .powerball-cell.is-hit {
  background: var(--lab-ui-red);
  border-color: var(--lab-ui-red);
  color: #1f0804;
}

.lab-shell .selected-ball,
.lab-shell .frequency-number {
  background: rgba(78, 161, 255, 0.18);
  color: #b9dbff;
}

.lab-shell .selected-ball.power,
.lab-shell .frequency-list.power .frequency-number {
  background: rgba(255, 107, 74, 0.16);
  color: #ffd0c6;
}

.lab-shell .disclaimer {
  background: rgba(70, 211, 154, 0.12);
  color: #c7f7df;
}

@media (max-width: 760px) {
  .site-header {
    position: sticky;
    top: 0;
    z-index: 20;
  }

  .site-nav {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: 10px 0;
  }

  .brand {
    font-size: 1.1rem;
    line-height: 1;
  }

  .header-links {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    width: 100%;
    max-width: 100%;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 0 8px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .header-links::-webkit-scrollbar {
    display: none;
  }

  .header-link {
    flex: 0 0 auto;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--lab-ui-line);
    color: var(--lab-ui-text);
  }

  .header-link:hover,
  .header-link:focus-visible {
    background: rgba(78, 161, 255, 0.12);
  }

  .hero {
    gap: 18px;
  }

  .hero-actions,
  .feature-actions,
  .form-actions {
    gap: 10px;
  }

  .primary-button,
  .ghost-button,
  button[type="submit"] {
    width: 100%;
  }

  .card,
  .panel,
  .hero-panel,
  .ticket-card,
  .table-panel,
  .main-panel,
  .details-panel > section {
    padding-inline: 16px;
  }

  .ticket-balls,
  .selected-balls {
    gap: 8px;
  }

  .lab-shell {
    width: min(100% - 24px, 1180px);
    padding: 20px 0 28px;
  }

  .lab-shell .hero {
    align-items: start;
    margin-bottom: 16px;
  }

  .lab-shell .controls {
    gap: 10px;
    padding: 12px;
  }

  .lab-shell .jump-controls {
    gap: 8px;
  }
}

@media (max-width: 420px) {
  .hero h1 {
    font-size: 2.85rem;
    line-height: 1;
  }

  .header-link {
    min-height: 40px;
    padding: 7px 10px;
    font-size: 0.84rem;
  }

  .ticket-ball,
  .selected-ball {
    width: 40px;
    height: 40px;
  }

  .lab-shell .main-grid {
    grid-template-columns: repeat(5, minmax(34px, 1fr));
  }
}
