/* Profiles pages (league / teams / players). Builds on the tokens in styles.css. */
.prof { --lg: #b9b0a3; }
.prof main a { color: inherit; }
.prof h1 { font-family: var(--display); font-stretch: var(--narrow); font-weight: 900; font-size: clamp(1.6rem, 6vw, 2.4rem); line-height: 1.1; letter-spacing: -.015em; }
.prof .muted { font-size: .78rem; }


/* Hero */
.phero {
  position: relative; overflow: hidden; isolation: isolate;
  background: linear-gradient(160deg, color-mix(in srgb, var(--team) 82%, white) 0%, var(--team) 55%, color-mix(in srgb, var(--team) 80%, var(--team-shade, #000)) 100%);
  background-color: var(--team); color: var(--team-ink, #fff); padding: 10px 16px 22px; border-radius: 0 0 28px 28px;
}
.phero .slogan { margin: 6px 0 0; }
.phero .eyebrow { color: rgba(255, 255, 255, .78); }
.phero a { color: #fff; }
.phero-id { display: flex; align-items: center; gap: 14px; }
.lede { margin-top: 10px; max-width: 70ch; font-size: .95rem; opacity: .95; }
.facts { margin-top: 4px; font-size: .82rem; opacity: .85; }
.eyebrow { font-size: .78rem; font-weight: 800; color: var(--muted); }
.ext { margin-top: 12px; font-size: .82rem; font-weight: 700; }
.badge { display: inline-block; margin-top: 8px; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 800; background: color-mix(in srgb, var(--c, var(--team)) 14%, transparent); }
.badge--hero { background: var(--team-accent); color: #0e1a33; }
.crest--lg { width: 56px; height: 56px; border-radius: 16px; font-size: 1.1rem; }

/* Stats: a ruled list like a scorebook, not boxes. tiles--lead makes the first one the headline number. */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 0 18px; margin: 16px 0 0; }
.tile { padding: 8px 0 9px; border-bottom: 1px solid var(--line); }
.phero .tile { border-bottom-color: rgba(255, 255, 255, .16); }
.tile dt { font-size: .74rem; font-weight: 800; color: var(--muted); }
.phero .tile dt { color: rgba(255, 255, 255, .78); }
.tile dd { margin: 2px 0 0; font-family: var(--display); font-stretch: var(--narrow); font-size: 1.35rem; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1.15; }
.tile p { font-size: .72rem; color: var(--muted); }
.phero .tile p { color: rgba(255, 255, 255, .75); }
.tiles--lead .tile:first-child { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 12px; padding: 0 0 10px; }
.tiles--lead .tile:first-child dd { order: -1; margin: 0; font-size: clamp(2.8rem, 13vw, 4rem); line-height: 1; letter-spacing: -.02em; }
.phero .tiles--lead .tile:first-child dd { color: var(--team-accent); }
.tiles--lead .tile:first-child dt { font-size: .95rem; color: inherit; }
.tiles--lead .tile:first-child p { flex-basis: 100%; font-size: .8rem; }
.trophy { width: 1.05em; height: 1.05em; vertical-align: -.15em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Layout */
.pblock { padding: 18px 16px; }
.pgrid { display: grid; }
.pgrid > * { min-width: 0; } /* tables scroll inside their column instead of widening the page */
.sub-h { margin: 14px 0 8px; font-size: .82rem; font-weight: 800; }
.sub-h:first-child { margin-top: 0; }

/* Roll of honour: one ruled row per season, the year large like a pavilion honours board. */
.honours { list-style: none; margin: 0; padding: 0; }
.hon { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 2px 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.hon:first-child { padding-top: 0; }
.hon-yr { grid-row: span 3; font-family: var(--display); font-stretch: var(--narrow); font-weight: 900; font-size: 1.15rem; line-height: 1.1; color: var(--muted); font-variant-numeric: tabular-nums; }
.hon-team { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.hon-team b { font-family: var(--display); font-stretch: var(--narrow); font-size: 1.2rem; font-weight: 900; }
.hon-final { font-size: .84rem; }
.hon-final span { display: block; color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; }
.hon-lead { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: .8rem; color: var(--ink-2); }
.hon-lead a { font-weight: 700; }

/* All-time team table */
.tlist { list-style: none; margin: 0; padding: 0; }
.tlist a { display: grid; grid-template-columns: 18px auto minmax(0, 1fr) minmax(48px, 90px) 46px; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.tlist li:last-child a { border-bottom: 0; }
.tlist a:hover .tl-name b { text-decoration: underline; }
.tl-rank { font-size: .74rem; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.tl-name { min-width: 0; }
.tl-name b { display: block; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-name small { font-size: .74rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.tl-bar { height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.tl-bar i { display: block; height: 100%; background: var(--ink-2); }
.tl-pct { text-align: right; font-family: var(--display); font-stretch: var(--narrow); font-size: 1.15rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.tl-pct small { font-size: .7rem; color: var(--muted); }

/* Teams tab: eight panels in each team's own colour, emblem large and faded behind. */
.lhead { max-width: var(--wrap); margin: 0 auto; padding: 18px 16px 4px; }
.lhead p { margin-top: 2px; font-size: .85rem; }
.tpanels { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 10px; padding: 12px 16px 0; }
.tpanel {
  position: relative; overflow: hidden; isolation: isolate; display: grid; align-content: start; gap: 3px; min-height: 190px;
  padding: 16px; border-radius: var(--radius); background: var(--c); color: var(--on, #fff); text-decoration: none;
  transition: transform .15s;
}
.tpanel:hover { transform: translateY(-2px); }
.prof main a.tpanel { color: var(--on, #fff); } /* beats the page's link colour reset */
.tp-mark { position: absolute; z-index: -1; right: -18px; bottom: -18px; width: 150px; height: 150px; color: var(--on, #fff); opacity: .1; }
.tpanel .crest--lg { margin-bottom: 8px; }
.tp-name { font-family: var(--display); font-stretch: var(--narrow); font-size: 1.4rem; font-weight: 900; line-height: 1.1; }
.tp-city { font-size: .78rem; opacity: .8; }
.tp-rec { margin-top: 8px; font-size: .84rem; font-variant-numeric: tabular-nums; }
.tp-rec b { font-family: var(--display); font-stretch: var(--narrow); font-size: 1.15rem; font-weight: 900; color: var(--a); }
.tp-title { font-size: .8rem; font-weight: 800; color: var(--a); }
.tp-key { font-size: .78rem; opacity: .85; }
@media (max-width: 600px) {
  .tpanels { grid-template-columns: 1fr 1fr; gap: 8px; }
  .tpanel { min-height: 0; padding: 12px; }
  .tpanel .crest--lg { width: 40px; height: 40px; margin-bottom: 4px; }
  .tp-name { font-size: 1.1rem; }
  .tp-mark { width: 100px; height: 100px; right: -14px; bottom: -14px; }
  .tp-city, .tp-key { display: none; }
  .tp-rec { margin-top: 4px; font-size: .74rem; }
}

/* Breadcrumb back to the list, top of team and player heroes */
.crumb { margin-bottom: 8px; font-size: .8rem; font-weight: 700; }
.crumb a { text-decoration: none; opacity: .85; }
.crumb a::before { content: "‹ "; }

/* Tables */
.tscroll { overflow-x: auto; }
.ptable { width: 100%; border-collapse: collapse; font-size: .84rem; font-variant-numeric: tabular-nums; }
.ptable th { text-align: left; font-size: .74rem; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); }
.ptable td { padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.standings tr:nth-child(-n+4) td:first-child { color: var(--good); font-weight: 800; }
.tlink { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-weight: 700; }
.tlink:hover { text-decoration: underline; }

/* Records as ruled rows: label, the number, who */
.rlist { margin: 0; }
.rrow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 4px 14px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .84rem; }
.rrow:last-child { border-bottom: 0; }
.rrow dt { color: var(--muted); font-weight: 700; }
.rrow dd { margin: 0; display: grid; gap: 1px; }
.rrow dd b { font-family: var(--display); font-stretch: var(--narrow); font-size: 1.25rem; font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; }
.rrow dd a { font-weight: 700; }
.rrow small { color: var(--muted); font-size: .76rem; }

/* Ranked bars (single series, neutral hue) */
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.bars li { display: grid; grid-template-columns: 18px auto minmax(0, 1.3fr) minmax(40px, 1fr) auto; align-items: center; gap: 8px; font-size: .84rem; }
.bars-rank { font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.bars-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars-name a { font-weight: 700; text-decoration: none; }
.bars-name a:hover { text-decoration: underline; }
.bars-name small { display: block; font-size: .7rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.bars-track { height: 8px; }
.bars-track span { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--ink-2); }
.bars li:hover .bars-track span { background: var(--ink); }
.bars b { font-family: var(--display); font-stretch: var(--narrow); font-variant-numeric: tabular-nums; text-align: right; min-width: 3ch; }

/* Phase comparison (two series + legend) */
.pc { display: grid; gap: 10px; }
.legend { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: .76rem; font-weight: 700; color: var(--ink-2); }
.key { width: 12px; height: 8px; border-radius: 2px; display: inline-block; }
.key--mine, .pc-bar--mine { background: var(--team); }
.key--lg, .pc-bar--lg { background: var(--lg); }
.key--lg { margin-left: 8px; }
.pc-row { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 10px; }
.pc-name { font-size: .82rem; font-weight: 700; }
.pc-name small { display: block; font-size: .68rem; color: var(--muted); font-weight: 500; }
.pc-bars { display: grid; gap: 2px; }
.pc-bars div { display: flex; align-items: center; gap: 6px; }
.pc-bar { display: block; height: 10px; border-radius: 0 4px 4px 0; min-width: 2px; }
.pc-bars b { font-size: .76rem; font-variant-numeric: tabular-nums; }

/* Traits */
.traits { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.traits li { padding: 10px 12px; border-radius: 12px; background: var(--paper); border: 1px solid var(--line); display: grid; gap: 2px; font-size: .84rem; }
.traits b::before { margin-right: 6px; }
.traits--good li { background: color-mix(in srgb, var(--good) 8%, transparent); }
.traits--good b::before { content: "▲"; color: var(--good); }
.traits--watch li { background: color-mix(in srgb, var(--bad) 8%, transparent); }
.traits--watch b::before { content: "▼"; color: var(--bad); }
.traits span { color: var(--ink-2); }

/* Highlights */
.hl { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: .88rem; }
.hl li::marker { content: "★ "; color: var(--six); }
.moments-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .84rem; }
.moments-list b { font-family: var(--display); font-stretch: var(--narrow); margin-right: 6px; }
.moments-list span { color: var(--ink-2); }

/* Players: ranked rows, scorebook style */
.pfilters { max-width: var(--wrap); margin: 0 auto; padding: 10px 16px 0; display: flex; flex-wrap: wrap; gap: 8px; }
.seg--scroll { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg--scroll::-webkit-scrollbar { display: none; }
.pfilters .seg button { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.plist { list-style: none; margin: 0; padding: 0; }
.plist a { display: grid; grid-template-columns: 22px auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.plist--plain a { grid-template-columns: auto minmax(0, 1fr) auto; }
.plist li:last-child a { border-bottom: 0; }
.plist a:hover .pl-name b { text-decoration: underline; }
.pl-rank { font-family: var(--display); font-stretch: var(--narrow); font-weight: 800; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.pl-name { min-width: 0; }
.pl-name b { display: block; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-name small { font-size: .74rem; color: var(--muted); }
.pl-stats { display: flex; gap: 14px; }
.pl-stats span { display: grid; justify-items: end; min-width: 34px; line-height: 1.05; }
.pl-stats b { font-family: var(--display); font-stretch: var(--narrow); font-size: 1.05rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.pl-stats small { font-size: .64rem; font-weight: 700; color: var(--muted); }
@media (max-width: 480px) { .pl-stats span:nth-child(n+3) { display: none; } }

@media (min-width: 900px) {
  .phero { padding: 14px 28px 28px; border-radius: 0 0 32px 32px; }
  .pgrid { grid-template-columns: 1fr 1fr; gap: 0 28px; }
  .pgrid--3 { grid-template-columns: repeat(3, 1fr); }
  .pblock { padding: 20px 8px; }
  .tpanels { padding-left: 8px; padding-right: 8px; grid-template-columns: repeat(4, 1fr); }
  .lhead, .pfilters { padding-left: 8px; padding-right: 8px; }
}

/* Dark theme (data-theme set by theme-init.js from the toggle or the system setting) */
:root[data-theme="dark"] .prof { --lg: #5e574d; }
:root[data-theme="dark"] .key--mine, :root[data-theme="dark"] .pc-bar--mine { background: color-mix(in srgb, var(--team) 65%, white); }
/* Team primaries are mostly near-black navies: lift the panels off the charcoal page with a hairline. */
:root[data-theme="dark"] .tpanel { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); }

.tile dd, .prof h1 { font-family: var(--display); font-stretch: var(--narrow); font-weight: 800; }

/* Nepal national team (#/nepal) */
.phero .seg--side { margin-bottom: 14px; background: rgb(0 0 0 / .18); }
.phero .seg--side a { color: #fff; }
.phero .seg--side a[aria-current] { color: var(--ink); }
.phero-id .flag { width: 28px; height: auto; flex: none; }
.pagebar .seg { overflow-x: auto; max-width: 100%; scrollbar-width: none; }
