@media screen and (max-width: 820px), screen and (max-width: 980px) and (pointer: coarse) {
  html, body { height: auto !important; overflow: visible !important; }
  body main.page { height: auto !important; min-height: 100dvh !important; overflow: visible !important; }
  body main.page > .topbar { height: auto !important; min-height: 0 !important; flex: 0 0 auto !important; padding: 16px; gap: 14px; }
  .nav { width: 100%; min-width: 0; flex-wrap: wrap; gap: 6px 12px; }
  .nav a:not([hidden]) { display: inline-flex !important; align-items: center; min-height: 44px !important; }
  .nav [hidden] { display: none !important; }
  body main.page > .content { min-width: 0; height: auto; overflow: visible; }
  .content h1 { font-size: 2.75rem; line-height: 1.08; overflow-wrap: anywhere; }
  .panel, .story-panel, .about-layout, .about-copy {
    height: auto;
    max-height: none;
    overflow: visible;
    scrollbar-gutter: auto;
  }
  .about-layout { flex: none; }
  .about-block p, .honor-note p, .audience-grid span { font-size: 1rem; line-height: 1.5; }
  .about-block h2 { font-size: 1.25rem; line-height: 1.2; }
  .footer, .site-info-footer { gap: 0; padding: 8px 12px; flex-shrink: 0; }
  .footer a, .site-info-footer a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 12px;
    border-left: 0 !important;
    font-size: 0.9rem;
  }
  input:not([type="checkbox"]):not([type="radio"]), select, textarea { font-size: 1rem; min-width: 0; max-width: 100%; }
  .btn, .primary-btn, .secondary-btn, .history-certificate-link, .photo-actions button {
    min-height: 44px;
    max-width: 100%;
    white-space: normal;
    text-align: center;
  }
  .content img { max-width: 100%; }
  .content p, .content a, .content h2 { overflow-wrap: anywhere; }
  .hero::after { background: linear-gradient(90deg, rgba(0,0,0,.65), rgba(0,0,0,.15)); }
}

@media screen and (max-width: 560px) {
  .content { width: calc(100% - 28px); padding-top: 22px; }
  .content h1 { font-size: 2.25rem; }
  .content h2 { line-height: 1.25; }
  .hero-actions { align-items: stretch; }
  .hero-action { max-width: 100%; white-space: normal; text-align: center; }
  .listing-controls { align-items: stretch; }
  .official-history-table, .leaderboard-table,
  .official-history-table tbody, .leaderboard-table tbody,
  .official-history-table tr, .leaderboard-table tr,
  .official-history-table td, .leaderboard-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }
  .official-history-table colgroup, .official-history-table thead, .leaderboard-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .official-history-table tr, .leaderboard-table tr { padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,.2); }
  .official-history-table td, .leaderboard-table td { padding: 6px 0; border: 0; text-align: left !important; }
  .official-history-table td[data-label]::before, .leaderboard-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 5px;
    color: #ffb25b;
    font-size: .875rem;
    font-weight: 800;
  }
  .history-score { grid-template-columns: 64px minmax(0,1fr); white-space: normal; overflow: visible; }
  .history-star-display { grid-column: 1 / -1; }
  .history-star-text { white-space: nowrap; }
  .leaderboard-table .participant { min-width: 0; align-items: center; }
  .leaderboard-table .score-cell { white-space: normal; flex-wrap: wrap; }
  .leaderboard-row-badge { max-width: 100%; white-space: normal; font-size: .75rem; }
}
