/* /league: the League hub (league.html). A scrolling column of sections;
   the Graph toggle opens the full-screen graph (graphView.css) on top.
   Colors follow [data-theme] (assets/graph/theme.js: ?dark / ?light / OS). */
:root { color-scheme: light dark;
  --bg: #f4f4f6; --card: #ffffff; --fg: #111; --muted: #5e5e63; --line: rgba(0,0,0,.1);
  --orange: #ff8a1e; --orange-text: #b35400; --on-orange: #1a0d00; }
[data-theme="dark"] { --bg: #0c0c0d; --card: #1d1d1f; --fg: #f5f5f5; --muted: #a6a6ab;
  --line: rgba(255,255,255,.12); --orange-text: #ff9c45; }

html, body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--fg); -webkit-text-size-adjust: 100%; }
html.graph-open, html.graph-open body { height: 100%; overflow: hidden; }

/* Side insets keep the page clear of the iPhone Duo's vertical bar. */
#hub { box-sizing: border-box; max-width: 760px; margin: 0 auto;
  padding: calc(16px + env(safe-area-inset-top, 0px)) calc(16px + env(safe-area-inset-right, 0px))
    calc(40px + env(safe-area-inset-bottom, 0px)) calc(16px + env(safe-area-inset-left, 0px)); }
#hub[hidden] { display: none; }
.hub-head h1 { margin: 0; font-size: 28px; font-weight: 800; font-style: italic; letter-spacing: -.5px; }
#seasonLine { margin: 4px 0 0; font-size: 11px; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: var(--orange-text); }
#seasonLine:empty { display: none; }

.hub-sec { margin-top: 28px; }
.hub-sec[hidden] { display: none; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.hub-sec h2 { margin: 0; font-size: 20px; font-weight: 800; }
.hub-sec h3 { margin: 22px 0 6px; font-size: 13px; font-weight: 800; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted); }
.note { margin: 0 0 10px; font-size: 13px; color: var(--muted); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.pill { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.pill.live { background: var(--orange); border-color: var(--orange); color: var(--on-orange); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px;
  padding: 0 16px; border-radius: 12px; font: inherit; font-size: 15px; font-weight: 700;
  text-decoration: none; cursor: pointer; border: 1px solid var(--line); color: var(--fg); background: transparent; }
.btn.primary { background: var(--orange); border-color: var(--orange); color: var(--on-orange); }

/* Now card */
.now-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.now-name { margin: 8px 0 2px; font-size: 22px; font-weight: 800; }
.now-meta { margin: 0; font-size: 14px; color: var(--muted); }
.now-big { margin: 12px 0 0; font-size: 17px; font-weight: 700; }
.now-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; }
.now-live { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.now-live li { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 700; }
.now-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

/* Cups list */
.cup-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.cup-list a { display: flex; align-items: center; gap: 12px; padding: 12px 2px; min-height: 44px;
  border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.cup-main { flex: 1; min-width: 0; }
.cup-name, .cup-meta { display: block; }
.cup-name { font-weight: 700; }
.cup-meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.cup-side { font-size: 13px; font-weight: 700; text-align: right; }

/* Tables: All players and standings */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { padding: 0; text-align: left; font-size: 11px; font-weight: 800; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
.tbl th > span { display: block; padding: 8px 4px; }
.tbl th button { all: unset; box-sizing: border-box; display: block; width: 100%; padding: 8px 4px; cursor: pointer; }
.tbl th[aria-sort="ascending"] button::after { content: " ▲"; }
.tbl th[aria-sort="descending"] button::after { content: " ▼"; }
.tbl th.num, .tbl td.num { text-align: right; }
.tbl td { padding: 10px 4px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:hover { background: var(--line); }
.tbl .rank { width: 28px; font-weight: 800; color: var(--muted); }
.tbl .who { all: unset; cursor: pointer; display: block; min-width: 0; }
.who-name { font-weight: 700; overflow-wrap: anywhere; }
.who-sub { display: block; font-size: 12px; color: var(--muted); }
.tbl .num { width: 52px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tbody tr.tier-row { cursor: default; }
.tbl tbody tr.tier-row:hover { background: none; }
.tbl .tier-row th { padding: 16px 4px 6px; font-size: 11px; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
.tbl .tier-row.top th { color: var(--orange-text); }

/* Tier map: the graph in miniature (tierMap.js); the whole card opens the full graph */
.sec-meta { font-size: 13px; color: var(--muted); }
.map-card { all: unset; box-sizing: border-box; display: block; width: 100%; margin-bottom: 12px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 16px; overflow: hidden; -webkit-tap-highlight-color: transparent; }
.map-card[hidden] { display: none; }
.map-card:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.map-card:active { background: var(--line); }
#map { display: block; width: 100%; height: 150px; }
.map-foot { display: flex; align-items: center; justify-content: flex-end; gap: 12px;
  padding: 8px 12px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.map-expand { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--fg); }
.map-expand svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* Full-screen graph (the map's Expand). Its header matches a cup bracket's
   (cup.css): "‹ League" top left (barPill.css), the title with a pill, one
   meta line. Loaded after graphView.css, which graph.html still uses as is. */
#graphView { position: fixed; inset: 0; z-index: 10; background: var(--bg); }
#graphView[hidden] { display: none; }
#graphView #bar { box-sizing: border-box; align-items: stretch; gap: 4px; text-align: left;
  padding-right: calc(16px + env(safe-area-inset-right, 0px)); padding-bottom: 14px;
  padding-left: calc(16px + env(safe-area-inset-left, 0px));
  background: linear-gradient(var(--bg) 72%, transparent); }
#graphView .bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
#graphView .bar-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#graphView #bar h1 { font-size: clamp(22px, 5vw, 32px); font-weight: 800; font-style: normal; letter-spacing: -.5px; }
#graphView #season { color: var(--muted); }
#graphView #season:empty { display: none; }
#graphView #status { margin: 0; font-size: 14px; color: var(--muted); opacity: 1; }
