/* EU Cup mobile refinement – 2026-10-12
   Loaded after styles.css, isolated to <=720px so desktop remains unchanged. */
@media (max-width: 720px) {
  html { -webkit-text-size-adjust: 100%; }
  body { min-width: 320px; }
  button, input, select { touch-action: manipulation; }

  /* The same compact, usable header on every public page. */
  body.public-page .site-header {
    position: sticky;
    top: 0;
    z-index: 60;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    min-height: 64px;
    padding: 8px 12px;
    gap: 8px;
  }
  body.public-page .brand { flex: 0 1 auto; min-width: 0; margin-right: auto; }
  body.public-page .brand-mark { flex: 0 0 40px; width:40px; height:40px; }
  body.public-page .brand-mark img { width:53px; height:53px; }
  body.public-page .brand-copy strong { font-size:23px; white-space:nowrap; }
  body.public-page .brand-copy small { display:none; }
  body.public-page .header-actions { display:flex; flex:0 0 auto; margin-left:auto; gap:8px; }
  body.public-page .language-picker select { width:auto; max-width:126px; min-height:42px; padding:0 25px 0 10px; font-size:12px; background:#fff; }
  body.public-page .mobile-menu-toggle {
    display:flex; flex:0 0 44px; width:44px; height:44px;
    align-items:center; justify-content:center; flex-direction:column; gap:5px;
    border:1px solid #dce4ed; border-radius:9px; background:#fff; color:#17375f;
  }
  body.public-page .mobile-menu-toggle span { display:block; width:17px; height:2px; border-radius:2px; background:currentColor; transition:transform .18s ease,opacity .18s ease; }
  .mobile-menu-open body.public-page .mobile-menu-toggle span:nth-child(1){transform:translateY(7px) rotate(45deg)}
  .mobile-menu-open body.public-page .mobile-menu-toggle span:nth-child(2){opacity:0}
  .mobile-menu-open body.public-page .mobile-menu-toggle span:nth-child(3){transform:translateY(-7px) rotate(-45deg)}
  body.public-page .primary-nav {
    top:calc(100% + 4px); left:12px; right:12px; width:auto; height:auto;
    display:grid; grid-template-columns:1fr; gap:2px; padding:7px;
    border-radius:11px; border:1px solid #dce4ed; background:#fff;
    box-shadow:0 18px 42px rgba(16,43,84,.15);
  }
  body.public-page .primary-nav a { display:flex; min-height:46px; height:auto; align-items:center; padding:9px 13px; font-size:12px; letter-spacing:.06em; border-radius:7px; }
  body.public-page .primary-nav a.active { background:#f0f4fa; }
  body.public-page .primary-nav a:focus-visible,
  body.public-page .mobile-menu-toggle:focus-visible { outline:2px solid #245895; outline-offset:2px; }

  /* Results – use the space for content, not decoration. */
  body.results-page .results-shell { padding:21px 10px 30px; }
  body.results-page .results-heading { margin-bottom:14px; }
  body.results-page .results-heading h2 { font-size:clamp(29px,8vw,37px); }
  body.results-page .archive-year-picker { margin-top:12px; }
  body.results-page .archive-year-picker select { min-height:44px; }
  body.results-page .board { border:1px solid #e2e8f0; border-radius:13px; overflow:clip; box-shadow:0 6px 18px rgba(19,45,87,.06); }
  body.results-page .board-tabs { grid-template-columns:repeat(3,minmax(0,1fr)); padding:3px 4px 0; }
  body.results-page .board-tab { min-width:0; min-height:52px; padding:6px 4px; gap:5px; font-size:9px; line-height:1.25; letter-spacing:0; font-weight:800; }
  body.results-page .board-tab svg { flex:0 0 17px; width:17px; height:17px; }
  body.results-page .filter-panel { padding:12px; gap:9px; }
  body.results-page .search-field { border-radius:7px; min-height:44px; }
  body.results-page .filter-grid { gap:9px; }
  body.results-page .filter-grid label { min-width:0; }
  body.results-page .filter-grid select { min-height:34px; max-width:100%; }
  body.results-page .clear-button { min-height:38px; }
  body.results-page .team-view { padding:12px 10px 14px; min-width:0; background:#f4f7fb; }
  body.results-page .team-ranking-head h3 { font-size:30px; }
  body.results-page .team-ranking-list { gap:10px; }

  /* Each team gets its own full-width card. Never put a dog gallery alongside its score. */
  body.results-page .team-rank,
  body.results-page .team-rank-expandable,
  body.results-page .team-winner { display:block; width:100%; min-width:0; padding:0; margin:0; border:1px solid #dce5ef; border-radius:12px; overflow:hidden; background:#fff; box-shadow:none; transform:none; }
  body.results-page .team-winner { border-color:#b3c9e4; box-shadow:0 5px 14px rgba(16,43,84,.10); }
  body.results-page .team-rank::before { display:none; }
  body.results-page .team-rank-summary,
  body.results-page .team-winner .winner-heading {
    display:grid; width:100%; min-width:0; min-height:76px;
    grid-template-columns:38px minmax(0,1fr) 42px;
    grid-template-rows:auto auto;
    grid-template-areas:"rank name toggle" "rank score toggle";
    align-items:center; column-gap:10px; row-gap:3px;
    padding:11px 12px; border-radius:0;
  }
  body.results-page .team-winner .winner-heading { border:0; }
  body.results-page .rank-number { grid-area:rank; width:36px; height:36px; border-radius:7px; font-size:17px; }
  body.results-page .rank-name { grid-area:name; min-width:0; align-self:end; }
  body.results-page .rank-name strong { display:block; min-width:0; overflow:visible; white-space:normal; overflow-wrap:anywhere; text-overflow:clip; font-size:14px; line-height:1.24; }
  body.results-page .rank-name small { display:none; }
  body.results-page .rank-score { grid-area:score; min-width:0; align-self:start; text-align:left; }
  body.results-page .rank-score strong { font-size:19px; line-height:1.1; white-space:nowrap; }
  body.results-page .rank-score small { display:none; }
  body.results-page .team-expand-button { grid-area:toggle; display:grid; width:42px; height:42px; align-self:center; justify-self:end; border-radius:8px; }
  body.results-page .team-expand-button span { font-size:22px; }
  body.results-page .team-winner .team-expand-button { background:rgba(255,255,255,.13); border-color:rgba(255,255,255,.35); color:#fff; }
  body.results-page .expanded-team-dogs { display:block; overflow:hidden; max-height:0; opacity:0; transition:max-height .38s ease,opacity .22s ease; }
  body.results-page .team-expanded > .expanded-team-dogs { max-height:960px; opacity:1; }
  body.results-page .expanded-team-dogs-inner { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); min-width:0; gap:8px; overflow:hidden; padding:0 10px; background:#f7f9fc; }
  body.results-page .team-expanded .expanded-team-dogs-inner { padding:10px; }
  body.results-page .expanded-team-dogs .winner-dog { width:100%; min-width:0; display:flex; flex-direction:column; padding:0; border:1px solid #e3e9f2; border-radius:9px; overflow:hidden; background:#fff; box-shadow:none; }
  body.results-page .expanded-team-dogs .winner-dog > img { display:block; width:100%; height:auto; aspect-ratio:4/3; object-fit:cover; object-position:center; }
  body.results-page .expanded-team-dogs .winner-dog-missing { display:grid; place-content:center; width:100%; height:auto; min-height:0; aspect-ratio:4/3; padding:6px; background:#eef3f9; color:#657b97; text-align:center; }
  body.results-page .expanded-team-dogs .winner-dog-missing b { font-size:11px; line-height:1.2; }
  body.results-page .expanded-team-dogs .winner-dog-info { display:flex; align-items:center; justify-content:center; gap:5px; width:100%; min-width:0; min-height:31px; padding:6px 3px; text-align:center; }
  body.results-page .expanded-team-dogs .winner-dog-info strong { display:block; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:11px; }
  body.results-page .expanded-team-dogs .winner-dog-info img.mini-flag { display:none; }

  /* Keep rankings readable instead of squeezing every desktop column onto a phone. */
  body.results-page .results-table th, body.results-page .results-table td { padding:12px 7px; }
  body.results-page .results-table td { font-size:12px; }
  body.results-page .results-table .dog-link { font-size:12px; }
  body.results-page .results-table th.placement-heading,
  body.results-page .results-table td.placement-cell { width:36px; min-width:36px; padding-left:8px; padding-right:1px; }
  body.results-page .placement-number { min-width:26px; font-size:12px; }
  body.results-page .mobile-row-meta { gap:5px; font-size:10px; line-height:1.4; }
  body.results-page .points-value { font-size:12px; overflow-wrap:anywhere; }
  body.results-page .dog-dialog { width:100%; max-width:100%; max-height:calc(100dvh - 24px); margin:auto 0 0; overflow-y:auto; }
  body.results-page .dog-profile-results { overflow-x:auto; }
  body.results-page .dog-profile-results table { min-width:280px; }

  /* My EU Cup and other content pages: no unnecessary mobile padding. */
  body.mec-dashboard .mec-main { padding:23px 13px 42px; }
  body.mec-dashboard .panel.account-panel { padding:15px; }
  body.mec-dashboard .dog-grid { grid-template-columns:1fr; }
  body.mec-dashboard .dog-card-wrap .dog-card { gap:12px; }
  body.mec-dashboard .dog-card-wrap .dog-photo { flex:0 0 82px; width:82px; height:82px; }
  body.mec-dashboard .section-head { flex-wrap:wrap; gap:8px; }
  body.mec-dashboard .account-intro { flex-wrap:wrap; }
  body.mec-dashboard .history-event summary { min-height:46px; }
  body.mec-dashboard .mec-settings-form input,
  body.mec-dashboard .mec-settings-form select { min-height:44px; }
  body.public-page .contact-section,
  body.public-page .contact-card { min-width:0; }
  body.public-page footer#about { gap:10px 16px; }
  body.public-page footer#about .footer-links { flex-wrap:wrap; }
}
@media (max-width: 380px) {
  body.public-page .brand-copy strong { font-size:20px; }
  body.public-page .language-picker select { max-width:102px; font-size:10px; }
  body.results-page .board-tab { font-size:8px; }
  body.results-page .expanded-team-dogs-inner { grid-template-columns:repeat(2,minmax(0,1fr)); }
  body.results-page .team-view { padding:9px 7px 12px; }
  body.results-page .rank-score strong { font-size:17px; }
}
@media (prefers-reduced-motion: reduce) {
  body.results-page .expanded-team-dogs, body.public-page .mobile-menu-toggle span { transition:none; }
}
/* Align Home with the same mobile header dimensions as the inner pages. */
@media (max-width: 720px) {
  body.home-page .site-header { min-height:64px; padding:8px 12px; gap:8px; }
  body.home-page .header-actions { gap:8px; }
  body.home-page .mobile-menu-toggle { flex:0 0 44px; width:44px; height:44px; border-radius:9px; }
  body.home-page .language-picker select { min-height:42px; max-width:126px; border-radius:7px; font-size:12px; }
  body.home-page .primary-nav { left:12px; right:12px; }
  body.home-page .primary-nav a { min-height:46px; height:auto; font-size:12px; }
}
@media (max-width: 380px) {
  body.home-page .language-picker select { max-width:102px; font-size:10px; }
}
/* Rank + dog + points on phones: team and discipline are shown beneath the dog name.
   Avoid duplicated team columns and multi-line numbers on narrow screens. */
@media (max-width: 720px) {
  body.results-page #totalsView th:nth-child(5),
  body.results-page #totalsView td:nth-child(5),
  body.results-page #disciplinesView th:nth-child(7),
  body.results-page #disciplinesView td:nth-child(7) { display:none; }
  body.results-page #totalsView th:nth-child(2),
  body.results-page #totalsView td:nth-child(2),
  body.results-page #disciplinesView th:nth-child(2),
  body.results-page #disciplinesView td:nth-child(2) { display:table-cell; width:auto; }
  body.results-page #totalsView th:nth-child(7),
  body.results-page #totalsView td:nth-child(7),
  body.results-page #disciplinesView th:nth-child(9),
  body.results-page #disciplinesView td:nth-child(9) { display:table-cell; width:93px; text-align:right; }
  body.results-page .points-value { font-size:12px; white-space:nowrap; }
  body.results-page #disciplinesView .mobile-row-meta b,
  body.results-page #disciplinesView .mobile-row-meta em:not(.mobile-discipline-name) { display:none; }
  body.results-page #disciplinesView .mobile-row-meta .mobile-discipline-name {
    display:inline-block; color:#536b87; font-weight:700; max-width:100%; overflow:hidden;
    text-overflow:ellipsis; white-space:nowrap;
  }
  body.results-page #totalsView .mobile-discipline-name { display:none; }
}
@media (max-width: 380px) {
  body.results-page #totalsView th:nth-child(7),
  body.results-page #totalsView td:nth-child(7),
  body.results-page #disciplinesView th:nth-child(9),
  body.results-page #disciplinesView td:nth-child(9) { width:83px; }
  body.results-page .results-table th,
  body.results-page .results-table td { padding-left:5px; padding-right:5px; }
  body.results-page .points-value { font-size:11px; }
}
