/* BadgerCalls: the home page of all sports (task #198, drawn by home.js). The owner's choice of 10.10,
   round 3: variant F (the chosen day's list on the left, its numbers on the right), chart W2 and the list
   "trafione + 1 chybiony". Its own block: every class starts with ha-, every colour is a token of v3.css
   (the palettes redefine them). The rows of the list are v3.css's own .row (rowHtml), untouched here. */

/* At / with no sport the start view shows only this; a sport's own Dziś shows everything else. */
.home-all { display: none; }
.view[data-view="start"].is-all > .home-all { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.view[data-view="start"].is-all > :not(.home-all) { display: none !important; }

/* ---------- the days and the day's line ---------- */
.ha-top { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
/* Relative: the tiles' words for screen readers (.vh, absolute) stay inside the strip that scrolls,
   else they widen the page on a phone. */
.ha-days { position: relative; }
.ha-ticks { display: inline-flex; gap: 2px; margin-left: 2px; vertical-align: -.15em; }
.ha-ticks .rmk { --rmk: 14px; }

/* ---------- two columns: the list, and the numbers beside it ---------- */
.ha-cols { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 28px; align-items: start; }
.ha-main { min-width: 0; }
.ha-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* The list: a choice, said so above it */
.ha-list { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.ha-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; margin: 0; font: 700 26px/1.1 var(--display); text-transform: uppercase; letter-spacing: .02em; color: var(--text-strong); }
.ha-head small { font: 500 13px/1.4 var(--font); text-transform: none; letter-spacing: 0; color: var(--text-muted); }
.ha-sport { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ha-sport-head {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin: 0; padding-bottom: 6px;
  border-bottom: 2px solid var(--border); font: 800 20px/1.15 var(--display); text-transform: uppercase; letter-spacing: .02em; color: var(--text-strong);
}
.ha-sport-head svg { width: 18px; height: 18px; align-self: center; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ha-sport-head small { font: 500 13px/1.4 var(--font); text-transform: none; letter-spacing: 0; color: var(--text-muted); }
.ha-sport-more { align-self: flex-start; font-size: 13.5px; }
/* #318: "+N nietrafionych" beside the sport's link to its whole day: quiet (the muted-on-surface text colour), a link all the same. */
.ha-sport-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; }
.ha-sport-miss { color: var(--text-2); font-weight: 500; }
.ha-comp { display: block; margin-top: 2px; font-size: 12px; font-weight: 500; color: var(--text-muted); }

/* ---------- W2: from the first pick on, a running total (drawn at the box's width, home.js) ---------- */
.ha-cum-big { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: 0; min-height: 78px; contain: layout; }   /* #321: the number, then its three short lines; they sit beside it when the box is wide enough, else under it, never wrapped around it */
.ha-cum-big > b { flex: none; font: 800 46px/1 var(--display); font-variant-numeric: tabular-nums; color: var(--text-strong); }
.ha-cum-txt { flex: 1 1 15.5em; min-width: 0; display: flex; flex-direction: column; gap: 1px; font-size: 13.5px; line-height: 1.4; color: var(--text-2); }
.ha-cum-txt > span, .ha-cum-txt > small { display: block; }
.ha-cum-txt small { font-size: 12.5px; color: var(--text-muted); }
.ha-cum-txt small i { display: block; font-style: normal; }
.ha-cum-txt b { color: var(--text-strong); }
.ha-key { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; font-size: 12.5px; color: var(--text-muted); }
.ha-key span { white-space: nowrap; }
.ha-key .ha-unit { margin-left: auto; }
.ha-sw { display: inline-block; width: 18px; margin-right: 6px; vertical-align: middle; border-top: 3px solid var(--hit); }
.ha-sw.is-e { border-top: 2px dashed var(--text-strong); }
.ha-cum-plot { min-height: 240px; margin: 0 -6px; }
.ha-cum-plot svg { display: block; width: 100%; height: auto; overflow: visible; fill: none; touch-action: pan-y; cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }   /* v3.css sizes every svg 20 px; pan-y: a vertical swipe scrolls the page, a sideways one slides across the days (#300) */
.ha-g { stroke: var(--border); stroke-width: 1; }
.ha-yl, .ha-xl { fill: var(--text-muted); font: 500 12px var(--font); font-variant-numeric: tabular-nums; }
.ha-xl.is-on { fill: var(--text-strong); font-weight: 700; }
.ha-e, .ha-h { fill: none; stroke-linejoin: round; stroke-linecap: round; }
.ha-e { stroke: var(--text-strong); stroke-width: 2; stroke-dasharray: 5 4; stroke-opacity: .8; }
.ha-h { stroke: var(--hit); stroke-width: 3; }
.ha-sel { stroke: var(--text-muted); stroke-width: 1; stroke-dasharray: 2 3; }
.ha-dot { fill: var(--hit); stroke: var(--surface); stroke-width: 2; }
.ha-dot.is-e { fill: var(--surface); stroke: var(--text-strong); }
.ha-pt { fill: var(--hit); }
.ha-hit { fill: transparent; }   /* catches the finger anywhere on the plot; the nearest day is found by x (home.js) */
.ha-read { display: flex; flex-direction: column; gap: 4px; }   /* the readout keeps its height while a day is touched, so the plot does not move under the finger */
.ha-cum-day { margin: 0; min-height: 1.4em; font-size: 13px; line-height: 1.4; color: var(--text-2); font-variant-numeric: tabular-nums; }
.ha-foot { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--text-muted); }

/* ---------- the chosen day's card ---------- */
.ha-kicker { margin: 0; font: 700 12px/1.3 var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.ha-wait { margin: 0; font-size: 14px; color: var(--text-2); }
.ha-bar { display: flex; gap: 2px; height: 12px; border-radius: 6px; overflow: hidden; background: var(--track); }
.ha-bar > i { display: block; min-width: 3px; height: 100%; flex-basis: 0; }
.ha-bar .is-h, .ha-pip.is-h { background: var(--hit); }
.ha-bar .is-m, .ha-pip.is-m { background: var(--miss); }
/* Still waiting: hatched (the muted text colour on the track), so it reads as "not yet", not as a missing bar. */
.ha-bar .is-o, .ha-pip.is-o { background: repeating-linear-gradient(135deg, var(--text-muted) 0 2px, transparent 2px 5px), var(--track); }
.ha-pip.is-v { background: transparent; border: 1.5px solid var(--text-muted); }
.ha-leg { display: flex; flex-wrap: wrap; gap: 2px 12px; margin: 0; font-size: 13.5px; line-height: 1.45; color: var(--text-2); }
.ha-leg b { color: var(--text-strong); }
/* The legend's numbers open the day cut to that result (#274). */
.ha-leg a { color: inherit; text-decoration: none; }
.ha-leg a:hover b, .ha-leg a[aria-current] b { text-decoration: underline; }
.ha-pip { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 3px; vertical-align: -1px; }
.ha-sum { font-size: 13px; color: var(--text-muted); }
.ha-prev b { color: var(--text-strong); }
.ha-split { display: flex; gap: 2px; height: 10px; min-width: 40px; border-radius: 5px; overflow: hidden; background: var(--track); }
.ha-split.is-big { height: 14px; border-radius: 7px; }
.ha-split > i { display: block; height: 100%; }
.ha-split .is-h { background: var(--hit); }
.ha-split .is-m { background: var(--miss); }
.ha-facts { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 13.5px; line-height: 1.45; color: var(--text-2); }
.ha-facts b { color: var(--text-strong); }

/* ---------- the day by sport and by tier: name | bar | x z y | % ---------- */
.ha-rows { display: grid; grid-template-columns: max-content minmax(48px, 1fr) max-content 40px; gap: 4px 12px; align-items: center; }
.ha-row { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; align-items: center; padding: 6px 8px; margin: 0 -8px; border-radius: var(--r-sm); color: inherit; text-decoration: none; }
a.ha-row:hover { background: var(--surface-2); }
.ha-name { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.ha-lab { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--text-strong); white-space: nowrap; }
.ha-lab svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
/* A sport mark (#147) paints itself; the line style above is for a sport without one. */
.ha-sport-head svg.spm, .ha-lab svg.spm { stroke: none; }
.ha-name small { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; }
.ha-cnt { font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ha-pct { font-size: 13.5px; font-weight: 700; color: var(--text-strong); text-align: right; font-variant-numeric: tabular-nums; }
.ha-pct .is-few { font-weight: 500; color: var(--text-muted); }
.ha-total { margin: 0; }

@media (max-width: 1199px) {
  .ha-cols { grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; }
}
/* One column: the numbers under the list, the chart across the page. */
@media (max-width: 980px) {
  .ha-cols { grid-template-columns: minmax(0, 1fr); }
}
/* A tablet: the chart across, the card and the two tables two by two under it. */
@media (min-width: 641px) and (max-width: 980px) {
  .ha-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .ha-side > .ha-cum { grid-column: 1 / -1; }
}
/* The switch Typy | Liczby (v3.css's .seg-tabs, as in Wyniki): a phone only. The picks come first; the numbers
   (chart, card, tables, total) are under the second half. A computer and a tablet show both, as before. */
.ha-tabs { display: none; }
@media (max-width: 720px) {
  /* #198: full-width tabs, the chosen one with a thick accent underline, an icon and a count in each, and the bar
     stays under the header while the list scrolls (sticky; the page background keeps rows from showing through). */
  .ha-tabs {
    display: flex; gap: 0; padding: 0 16px; margin: 0 -16px 12px; border: 0; border-bottom: 1px solid var(--border-hover);
    border-radius: 0; background: var(--bg); position: sticky; top: var(--head-h); z-index: 15;
  }
  .ha-tabs .seg-tab {
    position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 8px;
    border-radius: 0; font-size: 17px; color: var(--text-2);
  }
  .ha-tabs .seg-tab:hover { background: none; color: var(--text-strong); }
  .ha-tabs .seg-tab[aria-selected="true"], .ha-tabs .seg-tab[aria-selected="true"]:hover { background: none; color: var(--text-strong); font-weight: 800; }
  .ha-tabs .seg-tab[aria-selected="true"]::after {
    content: ""; position: absolute; left: 12%; right: 12%; bottom: -1px; height: 4px; border-radius: 4px 4px 0 0; background: var(--green);
  }
  .ha-ico { flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
  .ha-cnt-b { flex: none; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font: 800 12px/1.4 var(--font); font-variant-numeric: tabular-nums; }
  #home-all[data-tab="typy"] .ha-side, #home-all[data-tab="typy"] .ha-total { display: none; }
  #home-all[data-tab="liczby"] .ha-main { display: none; }
}
@media (max-width: 720px) {
  /* #299 (owner): on a phone the small "DZIŚ pn 12.10 · 28 typów" sat between the Typy | Liczby switch and the first sport, saying
     what the date tile and the tab's count already say. Gone from the eye, kept for a screen reader as the list's heading. */
  .ha-head { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }  .ha-leg { font-size: 13px; column-gap: 10px; }
  .ha-pip { margin-right: 4px; }
  .ha-cum-big > b { font-size: 40px; }
  .ha-cum-day { min-height: 2.8em; }   /* a phone: the day's line may take two lines; the room is kept so the chart does not move under the finger */
  .ha-cum-plot { margin: 0 -8px; }
  .ha-rows { gap: 2px 10px; }
}
/* #317 (owner: a lot of empty space right after the page opens): on a phone the blocks above the first pick sit closer, so
   a pick shows above the fold. The gap between the home page's blocks 22 -> 12 px, the days and their note 12 -> 8, the Typy | Liczby
   switch 52 -> 44 px tall with 4 px under it (the list's own gap makes it 16). A computer keeps its spacing. */
@media (max-width: 720px) {
  .view[data-view="start"].is-all > .home-all { gap: 12px; }
  .ha-top { gap: 8px; }
  .ha-tabs { margin-bottom: 4px; }
  .ha-tabs .seg-tab { min-height: 44px; }
  .ha-list { gap: 14px; }
}
