/* Shared responsive behaviour for Lottery-Checker's static pages. */
.mobile-nav-toggle,
.static-back-to-top,
.table-scroll-hint {
  display: none;
}

header nav a,
footer nav a,
.btn,
.cta,
.game-cta,
.calculator-actions button,
.odds-calculator button {
  min-height: 44px;
  align-items: center;
  justify-content: center;
}

.table-wrap {
  position: relative;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}

.static-back-to-top {
  position: fixed;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 80;
  min-height: 44px;
  padding: 9px 14px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 999px;
  background: var(--card, #fff);
  color: var(--text, #0f172a);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .16);
  font: 700 14px/1.2 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  text-decoration: none;
}

.static-back-to-top.is-visible {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.static-back-to-top:focus-visible,
.mobile-nav-toggle:focus-visible {
  outline: 3px solid #0ea5e9;
  outline-offset: 2px;
}

@media (max-width: 700px) {
  body > header,
  .shell > header {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center !important;
    gap: 10px !important;
  }

  body > header .brand,
  .shell > header .brand {
    min-width: 0;
  }

  body > header .brand span,
  .shell > header .brand span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 82px;
    min-height: 44px;
    padding: 8px 14px;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 999px;
    background: var(--card, #fff);
    color: var(--text, #0f172a);
    font: 750 14px/1.2 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    cursor: pointer;
  }

  html.static-nav-ready header nav[aria-label="Main navigation"] {
    display: none !important;
    grid-column: 1 / -1;
    width: 100%;
    margin-top: 2px;
  }

  html.static-nav-ready header nav[aria-label="Main navigation"].is-open {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  html.static-nav-ready header nav[aria-label="Main navigation"] a {
    display: flex;
    width: 100%;
    min-height: 44px;
    padding: 8px 10px;
    text-align: center;
    white-space: normal;
  }

  .table-scroll-hint {
    position: sticky;
    left: 0;
    display: block;
    width: max-content;
    max-width: calc(100vw - 52px);
    margin: 8px 10px 6px;
    padding: 5px 9px;
    border-radius: 999px;
    background: #e0f2fe;
    color: #075985;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
  }

  .table-wrap table th:first-child,
  .table-wrap table td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--card, #fff);
    box-shadow: 1px 0 0 var(--border, #e5e7eb);
  }

  .table-wrap table th:first-child {
    z-index: 2;
    background: var(--soft, #f8fafc);
  }

  footer {
    padding-bottom: 62px !important;
  }

  footer nav {
    width: 100%;
    gap: 8px !important;
  }

  footer nav a {
    display: inline-flex;
  }
}

@media (max-width: 390px) {
  html.static-nav-ready header nav[aria-label="Main navigation"].is-open {
    grid-template-columns: 1fr;
  }
}
