/* HoopPact mobile layer (draft). Applies only below 640px; desktop is untouched. */
@media (max-width: 640px) {
  /* Touch feedback */
  a, button, [role="button"], summary { -webkit-tap-highlight-color: rgba(0, 0, 0, .06); }

  /* Section titles: smaller, sentence case, subtitle below the title */
  .hpx-head { display: block !important; }
  .hpx-head h2, .hp-panel > h2, .hp-club-directory h2, .hp-compact-budgets h2,
  html[data-hp-theme] body .hpx-head h2.hpx-head-h, html[data-hp-theme] body .hpx-head h2:not(#x) {
    font-size: 17px !important; line-height: 1.25 !important; text-transform: none !important;
    letter-spacing: 0 !important; margin: 0 0 2px !important;
  }
  .hpx-head > :not(h2) { display: block !important; margin: 0 !important; font-size: 12px !important;
    white-space: normal !important; overflow: visible !important; max-width: none !important; }

  /* League lists: whole row is a tappable card with a chevron */
  html body .cq-lb-row, html[data-hp-theme] body .hpx-te .cq-lb-row.cq-lb-row { position: relative; padding-right: 30px !important; min-height: 56px; }
  .cq-lb-row::after { content: "\203A"; position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    font-size: 24px; line-height: 1; color: var(--hp-muted, #8a94a3); pointer-events: none; }
  .cq-lb-row:active { background: rgba(0, 0, 0, .05); }

  /* Team page: club head, form, then tabs and content; money cards follow the content */
  #hpTeam { display: flex !important; flex-direction: column !important; }
  #hpTeam > * { order: 10; }
  #hpTeam > .hp-breadcrumb { order: 1; }
  #hpTeam > .hp-context-bar { order: 2; }
  #hpTeam > .hp-team-head { order: 3; }
  #hpTeam > #hpxTeamForm { order: 4; }
  #hpTeam > .hp-tabs { order: 5; }
  #hpTeam > #hpTeamPanel { order: 6; }
  #hpTeam > #hpxTeamMoney { order: 7; margin-top: 16px; }
  #hpTeam > .hp-roster-evidence { order: 8; }

  .hp-context-bar { padding: 10px 12px !important; }
  .hp-context-bar select { width: 100%; min-height: 44px; border-radius: 10px; font-size: 16px; padding: 0 12px; }
  .hp-context-bar label, .hp-context-bar > span { font-size: 12px; }

  /* Form card: two columns, less padding */
  .hpx-team-form { padding: 12px !important; }
  .hpx-tf-grid { gap: 10px !important; }
  .hpx-tf-asof { font-size: 12px !important; margin-top: 6px !important; }

  /* Tabs: sticky, scrollable, with a fade showing there is more */
  .hp-tabs, [role="tablist"], #viewPlayer .tabs {
    overflow-x: auto !important; flex-wrap: nowrap !important; white-space: nowrap; scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent);
            mask-image: linear-gradient(90deg, #000 82%, transparent);
  }
  .hp-tabs::-webkit-scrollbar, [role="tablist"]::-webkit-scrollbar, #viewPlayer .tabs::-webkit-scrollbar { display: none; }
  .hp-tabs.hpm-end, [role="tablist"].hpm-end, #viewPlayer .tabs.hpm-end { -webkit-mask-image: none; mask-image: none; }
  .hp-tabs { position: sticky; top: 0; z-index: 30; background: var(--hp-bg, var(--bg, #fff)); }
  .hp-tabs button, [role="tablist"] > *, #viewPlayer .tabs > .tab { min-height: 44px; flex: 0 0 auto; }

  /* Tables stacked as cards: tap feedback */
  .hpx-stack tr { position: relative; }
  .hpx-stack tr:active { background: rgba(0, 0, 0, .04); }

  /* Money cards: sums as chips, notes folded */
  .hpm-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 4px; }
  .hpm-chip { display: inline-flex; flex-direction: column; padding: 6px 10px; border-radius: 10px;
    border: 1px solid var(--hp-line, #d8dee6); font-size: 15px; font-weight: 800; line-height: 1.2; }
  .hpm-chip small { font-size: 11px; font-weight: 600; color: var(--hp-muted, #6b7685); }
  .hpx-tm-sum.hpm-done { font-size: 0 !important; margin: 0 !important; }
  .hpx-tm-sum.hpm-done .hpm-chips { font-size: 15px; }
  details.hpm-note { margin-top: 8px; font-size: 13px; }
  details.hpm-note > summary { cursor: pointer; font-weight: 700; font-size: 13px; color: var(--hp-muted, #55606e);
    list-style: none; min-height: 32px; display: flex; align-items: center; gap: 6px; }
  details.hpm-note > summary::-webkit-details-marker { display: none; }
  details.hpm-note > summary::before { content: "\24D8"; font-size: 15px; }
  details.hpm-note[open] > summary { margin-bottom: 4px; }
  details.hpm-note p { margin: 0 !important; }

  /* Footer: shorter */
  .site-footer .footer-inner { gap: 18px !important; padding-top: 0 !important; }
  .site-footer .footer-about p { font-size: 13px !important; }
  .site-footer .footer-links { display: flex !important; flex-wrap: wrap; gap: 4px 14px; }
  .site-footer .footer-links li { margin: 0 !important; }
  .site-footer .footer-links a { display: inline-block; padding: 6px 0; }
}

@media (max-width: 640px) {
  /* Team roster: one compact card per player (name, then position · nationality · height · number) */
  .hpx-stack tr:has(td[data-label="cm"]) { display: flex !important; flex-wrap: wrap; align-items: baseline;
    gap: 2px 8px; padding: 10px 34px 10px 12px !important; position: relative; }
  .hpx-stack tr:has(td[data-label="cm"])::after { content: "\203A"; position: absolute; right: 12px; top: 50%;
    transform: translateY(-50%); font-size: 24px; color: var(--hp-muted, #8a94a3); }
  .hpx-stack tr:has(td[data-label="cm"]) td { display: inline !important; padding: 0 !important; border: 0 !important;
    font-size: 13px !important; color: var(--hp-muted, #55606e); width: auto !important; }
  .hpx-stack tr:has(td[data-label="cm"]) td::before { content: none !important; display: none !important; }
  .hpx-stack tr:has(td[data-label="cm"]) td:first-child { flex-basis: 100%; font-size: 16px !important; font-weight: 700; color: inherit; }
  .hpx-stack tr:has(td[data-label="cm"]) td:not(:first-child):not(:last-child)::after { content: " ·"; }
  .hpx-stack tr:has(td[data-label="cm"]) td[data-label="cm"]::after { content: " cm ·" !important; }
  .hpx-stack tr:has(td[data-label="cm"]) td:last-child::before { content: "#" !important; display: inline !important; }
}
@media (max-width: 640px) {
  html body .hpx-stack tr:has(td[data-label="cm"]) td, html body .hpx-stack tr:has(td[data-label="cm"]) { background: transparent !important; box-shadow: none !important; }
  .hpx-stack tr:has(a.pname-link) { cursor: pointer; }
}

/* t-20261124: mobile round 2 */
.hpm-stat-grid,.hpm-ends{display:none}
@media (max-width:640px){
  html[data-hp-theme] body #hpPortal .hp-welcome h1#hpWelcomeTitle,html[data-hp-theme] body #hpPortal.hpx-market-portal .hp-welcome h1#hpWelcomeTitle{font-size:25px!important;line-height:1.12!important;letter-spacing:0!important;margin-bottom:8px!important}
  .hp-table-scroll.hpm-has-grid,.hp-table-scroll.hpm-has-ends,table.hpm-has-ends{display:none!important}
  .hpm-stat-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px;margin:8px 0 12px}
  .hpm-stat-grid>div{display:flex;flex-direction:column;align-items:center;padding:8px 2px;border:1px solid var(--hp-line,rgba(127,127,127,.25));border-radius:8px;background:var(--hp-surface,transparent)}
  .hpm-stat-grid b{font-size:17px;line-height:1.2;font-weight:800;color:var(--hp-text,#132a4a)}
  .hpm-stat-grid span{font-size:11px;letter-spacing:.04em;color:var(--hp-muted,#5b6577);margin-top:2px}
  .hpm-ends{display:block;margin:6px 0 10px;padding:0 12px}
  .hpm-ends h4{display:flex;align-items:center;gap:8px;margin:14px 0 6px;font-size:14px;font-weight:800;color:var(--hp-text,#132a4a)}
  .hpm-ends h4 span{font-size:12px;font-weight:700;padding:1px 8px;border-radius:999px;background:var(--hp-line,rgba(127,127,127,.18))}
  .hpm-ends ul{list-style:none;margin:0;padding:0;border:1px solid var(--hp-line,rgba(127,127,127,.25));border-radius:8px;overflow:hidden}
  .hpm-ends li{display:flex;align-items:center;gap:8px;min-height:44px;padding:8px 12px;border-top:1px solid var(--hp-line,rgba(127,127,127,.18));font-size:15px}
  .hpm-ends li:first-child{border-top:0}
  .hpm-ends li>a:first-child{font-weight:600;color:var(--hp-text,#132a4a)}
  .hpm-ends li small{font-size:12px;color:var(--hp-muted,#5b6577)}
  .hpm-ends .hpm-src{margin-left:auto;font-size:13px;white-space:nowrap}
}

/* u3-20261124: Sources page table fits the phone width */
@media (max-width:640px){#pageSources table.conf-table{table-layout:fixed;width:100%}#pageSources table.conf-table th,#pageSources table.conf-table td{overflow-wrap:anywhere;hyphens:auto}}
