/* Home page (index.html), on top of signal.css. */

/* ---------- Hero: the question, the week's spread, and today's best match ---------- */

.hm-hero { padding: 44px 0 48px; background: var(--ink); color: #fff; }

.hm-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 470px);
    gap: 48px;
    align-items: start;
}

.hm-hero h1 { max-width: 13ch; font-size: clamp(2.4rem, 4.8vw, 4rem); line-height: 1.02; letter-spacing: -0.025em; }
.hm-hero-sub { margin-top: 18px; color: var(--ink-text-2); font-size: 17px; }
.hm-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }

.hm-dist { margin-top: 44px; }
.hm-dist-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; }
.hm-dist-title { font-size: 1.25rem; }

.hm-chart {
    position: relative;
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    align-items: end;
    gap: 4px;
    height: 150px;
    margin-top: 20px;
    border-bottom: 1px solid var(--ink-line);
}

.hm-bar { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.hm-bar-count { margin-bottom: 6px; color: var(--ink-text-2); font: 400 11px var(--mono); text-align: center; }
.hm-bar-fill { min-height: 2px; border-radius: 2px 2px 0 0; }
.hm-bar.tier-lim .hm-bar-fill { background: #3D4A6B; }
.hm-bar.tier-con .hm-bar-fill { background: #7C4422; }
.hm-bar.tier-rec .hm-bar-fill { background: #C8581D; }
.hm-bar.tier-must .hm-bar-fill { background: var(--accent); }

.hm-chart-mark { position: absolute; top: -6px; bottom: 0; width: 0; border-left: 1px dashed var(--accent); }

.hm-chart-mark span {
    position: absolute;
    top: 0;
    right: 6px;
    color: var(--accent);
    font: 600 12.5px var(--font);
    white-space: nowrap;
}

.hm-axis { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; margin-top: 6px; color: var(--ink-text-3); font: 400 10px var(--mono); }

.hm-bands { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 18px; }

.hm-band {
    display: grid;
    gap: 6px;
    padding: 12px 14px;
    border: 1px solid var(--ink-line);
    border-radius: var(--r);
    background: var(--ink-raised);
}

.hm-band-num { font-weight: 800; font-size: 1.9rem; line-height: 1; font-variant-numeric: tabular-nums; }
.hm-band-label { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; line-height: 1.2; }
.hm-band-range { color: var(--ink-text-3); font: 400 10px var(--mono); }

/* Featured match */
.hm-feature {
    padding: 22px;
    border: 1px solid var(--ink-line);
    border-radius: 16px;
    background: var(--ink-raised);
    --tick: var(--ink-raised);
}

.hm-feature-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }

.hm-badge {
    padding: 6px 9px;
    border-radius: 6px;
    background: var(--tier);
    color: var(--ink);
    font: 600 12.5px/1 var(--font);
}

.hm-feature-teams { display: grid; gap: 10px; margin-top: 20px; }
.hm-feature-team { display: flex; align-items: center; gap: 10px; font-size: clamp(1.35rem, 2.2vw, 1.75rem); }
.hm-feature-team .team-name { font-weight: 700; line-height: 1.1; }
.hm-feature .score-xl { margin-top: 14px; }
.hm-feature .band-bar { height: 6px; margin-top: 16px; background: #26314F; }
.hm-feature .fp-lg { margin-top: 16px; }

.hm-feature-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-top: 18px; }
.hm-feature-foot p { flex: 1 1 14rem; color: var(--ink-text-2); font-size: 14px; }
.hm-feature-foot b { color: #fff; font-weight: 600; }

.hm-next { margin: 22px 0 0; padding: 0; list-style: none; }

.hm-next li {
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 11px 0;
    border-top: 1px solid var(--ink-line);
}

.hm-next a, .hm-next li > span:nth-child(2) { overflow: hidden; color: #fff; font-weight: 600; font-size: 14px; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.hm-next a:hover { text-decoration: underline; }
.hm-next .score { color: #fff; }
.hm-next .score-dec { color: var(--ink-text-3); }

@media (max-width: 1023px) {
    .hm-hero-grid { grid-template-columns: minmax(0, 1fr); gap: 36px; }
    .hm-hero h1 { max-width: 15ch; }
}

@media (max-width: 560px) {
    .hm-hero { padding-top: 32px; }
    .hm-bands { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hm-chart { height: 110px; }
    .hm-bar-count { font-size: 9.5px; }
    .hm-feature { padding: 18px; }
    .hm-actions .btn { flex: 1 1 auto; }
}

/* ---------- Section heads ---------- */

.hm-section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px 16px;
    margin: 44px 0 16px;
}

.hm-section-head h2 { display: flex; align-items: center; gap: 10px; font-size: clamp(1.4rem, 2.4vw, 1.7rem); }
.hm-section-head p { color: var(--text-2); font-size: 14px; }
.hm-section-head .live-dot { width: 9px; height: 9px; background: var(--live); }

/* ---------- Live now ---------- */

/* One scrolling row at every width: four cards in view on desktop, the rest a scroll away. */
.hm-live-grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(260px, calc((100% - 36px) / 4));
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
}

.hm-live-grid::-webkit-scrollbar { display: none; }
.hm-live-grid > * { scroll-snap-align: start; }
.hm-live-grid.is-empty { display: block; }

.hm-live-tools { display: flex; align-items: center; gap: 14px; }
.hm-scroll-btns { display: flex; gap: 6px; }

.hm-scroll-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.15s, opacity 0.15s;
}

.hm-scroll-btn:hover:not(:disabled) { border-color: var(--line-strong); }
.hm-scroll-btn:disabled { opacity: 0.4; cursor: default; }

.hm-live-card { display: grid; gap: 12px; padding: 16px; }
.hm-live-top { display: flex; justify-content: space-between; gap: 10px; }
.hm-live-minute { display: inline-flex; align-items: center; gap: 6px; color: var(--live); font: 600 12px var(--mono); }
.hm-live-minute.is-paused { color: var(--text-3); }
.hm-live-minute.is-paused .live-dot { background: var(--line-strong); }
.hm-live-minute .live-dot { background: var(--live); }
.hm-live-progress { height: 3px; overflow: hidden; border-radius: 2px; background: var(--line-soft); }
.hm-live-progress span { display: block; height: 100%; background: var(--live); }
.hm-live-progress.is-paused span { background: var(--line-strong); }
.hm-live-team { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.hm-live-team .team-name { overflow: hidden; font-size: 14.5px; text-overflow: ellipsis; white-space: nowrap; }
.hm-live-goals { font-weight: 800; font-size: 1.5rem; line-height: 1; font-variant-numeric: tabular-nums; }
.hm-live-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.hm-live-foot .meta { font-size: 12px; white-space: nowrap; }
.hm-live-foot > span:last-child { display: inline-flex; align-items: center; gap: 10px; }
.hm-live-empty { grid-column: 1 / -1; padding: 18px 20px; color: var(--text-2); }

@media (max-width: 720px) {
    /* Swiping does the job on a phone. */
    .hm-scroll-btns { display: none; }
}

/* ---------- Browse by competition ---------- */

.hm-comps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.hm-comp { display: grid; align-content: start; gap: 12px; padding: 16px 18px; }
.hm-comp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.hm-comp-name { font-weight: 700; font-size: 1.1rem; line-height: 1.15; text-decoration: none; }
a.hm-comp-name:hover { text-decoration: underline; }
.hm-comp-tag { flex-shrink: 0; padding: 3px 6px; border: 1px solid var(--line); border-radius: 6px; color: var(--text-3); font: 500 12px var(--font); }

.hm-strip {
    position: relative;
    height: 26px;
    border-radius: 4px;
    background: linear-gradient(to right, var(--heat-0) 0 40%, #FFF3E8 40% 60%, #FFE6D2 60% 85%, #FFDCCB 85% 100%);
}

.hm-strip span { position: absolute; top: 5px; bottom: 5px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--tier); }
.hm-strip .tier-lim { --tier: #8B94A1; }
.hm-strip .tier-con { --tier: #EE9A55; }
.hm-strip-axis { display: flex; justify-content: space-between; margin-top: 4px; color: var(--text-3); font: 400 10px var(--mono); }

.hm-comp-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.hm-comp-top .meta { display: block; font-size: 12px; }
.hm-comp-top a, .hm-comp-top div > span:last-child { display: block; margin-top: 3px; overflow: hidden; font-weight: 600; font-size: 14px; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.hm-comp-top a:hover { text-decoration: underline; }

.hm-weekly-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.hm-weekly-links .chip { padding: 6px 12px; font-size: 13px; }

@media (max-width: 1100px) { .hm-comps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .hm-comps { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Filters ---------- */

.hm-filters {
    position: sticky;
    top: 0;
    z-index: 30;
    margin-top: 44px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
    background: var(--ground);
}

.hm-days { gap: 6px; }

.hm-day {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 2px;
    min-width: 58px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: var(--surface);
    cursor: pointer;
    transition: border-color 0.15s;
}

.hm-day:hover { border-color: var(--line-strong); }
.hm-day-name { color: var(--text-3); font: 500 12px var(--font); }
.hm-day-num { font-weight: 700; font-size: 1.2rem; line-height: 1.1; white-space: nowrap; }
.hm-day[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.hm-day[aria-pressed="true"] .hm-day-name { color: var(--ink-text-2); }
.hm-day.is-today::after { content: ''; position: absolute; top: 6px; right: 6px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.hm-day:disabled { opacity: 0.45; cursor: default; }

.hm-filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; }
.hm-filter-row .scroll-row { flex: 1 1 22rem; min-width: 0; margin-right: 6px; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); }
.hm-filter-row .chip { padding: 7px 13px; font-size: 13.5px; }

.hm-search { position: relative; display: flex; align-items: center; gap: 8px; }
.hm-search label { color: var(--text-2); font: 500 13.5px var(--font); }
.hm-search-field { position: relative; display: block; }
.hm-search-field .icon { position: absolute; left: 12px; top: 50%; color: var(--text-3); transform: translateY(-50%); pointer-events: none; }

.hm-search input {
    width: 13rem;
    padding: 8px 12px 8px 34px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font: 400 14px var(--font);
}

.hm-search input::placeholder { color: var(--text-3); }
.hm-search input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.hm-sort { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.hm-sort button { padding: 6px 12px; border: 0; border-radius: 999px; background: transparent; font: 500 13px var(--font); cursor: pointer; }
.hm-sort button[aria-pressed="true"] { background: var(--ink); color: #fff; }

@media (max-width: 720px) {
    /* On a phone the filter block is too tall to pin; it scrolls with the page. */
    .hm-filters { position: static; margin-top: 32px; }
    .hm-search { flex: 1 1 100%; }
    .hm-search label { display: none; }
    .hm-search-field, .hm-search input { width: 100%; }
}

/* ---------- Three columns: sidebar, matches, rail ---------- */

.hm-layout {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr) 300px;
    gap: 24px;
    align-items: start;
    margin-top: 24px;
}

.hm-side { display: grid; gap: 28px; }
.hm-side h2 { margin-bottom: 8px; color: var(--text-2); font: 700 13.5px var(--font); letter-spacing: 0; }
.hm-side ul { margin: 0; padding: 0; list-style: none; }

.hm-side-link {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 6px 0;
    border: 0;
    background: none;
    color: var(--text);
    font: 500 14px/1.3 var(--font);
    text-align: left;
    cursor: pointer;
}

.hm-side-link:hover { text-decoration: underline; }
.hm-side-link[aria-pressed="true"] { font-weight: 700; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
.hm-side-link .meta { font-size: 12px; }
.hm-side-more { margin-top: 6px; }
.hm-side-teams { display: flex; flex-wrap: wrap; gap: 6px; }
.hm-side-teams .chip { padding: 6px 11px; font-size: 13px; }

@media (max-width: 1199px) {
    .hm-layout { grid-template-columns: minmax(0, 1fr) 300px; }
    .hm-side { display: none; }
}

@media (max-width: 1023px) {
    .hm-layout { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Match table ---------- */

.hm-list-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin-bottom: 14px; }
.hm-list-head h2 { font-size: 1.45rem; }

.hm-table { overflow: hidden; }

.mrow-grid {
    display: grid;
    grid-template-columns: 30px 64px minmax(0, 1fr) auto 118px;
    align-items: center;
    gap: 16px;
}

.hm-table-head { padding: 12px 18px; border-bottom: 1px solid var(--line); color: var(--text-3); font: 500 12.5px var(--font); }
.hm-table-head span:last-child { text-align: right; }

.hm-rows { margin: 0; padding: 0; list-style: none; }

.mrow { position: relative; padding: 14px 18px; border-top: 1px solid var(--line-soft); transition: background-color 0.15s; }
.mrow:first-child { border-top: 0; }
.mrow:hover { background: #FAFBFC; }
.mrow[hidden] { display: none; }

.mrow-rank { color: var(--text-3); font: 500 12px var(--mono); font-variant-numeric: tabular-nums; }
.mrow-rank.is-top { color: var(--accent); font-weight: 600; }
.mrow-time { display: grid; gap: 2px; font-family: var(--mono); }
.mrow-time time:first-child { font-weight: 600; font-size: 14px; }
.mrow-time time:last-child { color: var(--text-3); font-size: 11px; }
.mrow-match { display: grid; gap: 5px; min-width: 0; }
.mrow-match .meta { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.mrow-teams { display: grid; gap: 5px; color: inherit; text-decoration: none; }
.mrow-teams::after { content: ''; position: absolute; inset: 0; }
.mrow-team { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 15px; }
.mrow-team .team-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.mrow-teams:hover .team-name { text-decoration: underline; }
.mrow-mmeta { display: none; }

.mrow-ad { padding: 14px 18px; border-top: 1px solid var(--line-soft); background: var(--ground); }

.hm-more { display: grid; justify-items: center; gap: 10px; padding: 20px; border-top: 1px solid var(--line-soft); }
.hm-more-status { display: inline-flex; align-items: center; gap: 8px; color: var(--text-3); font-size: 13px; }
.hm-more-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.hm-none { padding: 28px 20px; color: var(--text-2); text-align: center; }

@media (max-width: 720px) {
    .hm-table-head { display: none; }

    .mrow-grid {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas: "mmeta score" "match score" "fp fp";
        gap: 8px 12px;
    }

    .mrow { padding: 14px 16px; }
    .mrow-rank, .mrow-time, .mrow-match > .meta { display: none; }
    .mrow-mmeta { display: block; grid-area: mmeta; font-size: 12px; }
    .mrow-match { grid-area: match; }
    .mrow .fp { grid-area: fp; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 3px; }
    .mrow .fp-swatch { width: 100%; height: 8px; }
    .mrow .score-stack { grid-area: score; align-self: start; }
    .mrow .score-md { font-size: 1.8rem; }
}

/* ---------- FAQ and recent results ---------- */

.hm-faq { margin-top: 56px; padding: 44px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); }
.hm-faq-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 32px; }
.hm-faq h2 { margin-bottom: 24px; font-size: clamp(1.4rem, 2.4vw, 1.7rem); }
.hm-faq h3 { font-size: 1.05rem; line-height: 1.25; }
.hm-faq p { margin-top: 8px; color: var(--text-2); font-size: 14.5px; }
.hm-faq a { color: var(--text); font-weight: 600; }

.hm-recent { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.hm-recent a { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); text-decoration: none; transition: border-color 0.15s; }
.hm-recent a:hover { border-color: var(--line-strong); }
.hm-recent b { font-weight: 600; font-size: 14px; }

@media (max-width: 900px) {
    .hm-faq-grid, .hm-recent { grid-template-columns: minmax(0, 1fr); }
}
