/* Player analytics and game center. Builds on edge.css tokens. */

.an-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--edge-text-3); font: 500 .8rem/1.4 var(--edge-mono); margin-top: 6px; }
.an-tabs { margin: 22px 0 20px; }
.an-view[hidden] { display: none !important; }
.an-controls { display: grid; gap: 14px; padding: 16px; border: 1px solid var(--edge-line); border-radius: var(--edge-r-lg); background: var(--edge-surface-1); margin-bottom: 14px; }
.an-row { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.an-row .label { font: 600 .68rem/1 var(--edge-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--edge-text-3); min-width: 72px; }
.an-row select, .an-row input[type="search"] { width: auto; min-width: 160px; min-height: 38px; padding-top: 6px; padding-bottom: 6px; font-size: .9rem; }
.an-row input[type="range"] { accent-color: var(--edge-volt); width: 180px; }
.an-row .chip { min-height: 34px; padding: 0 12px; font-size: .84rem; }
.an-note { color: var(--edge-text-3); font-size: .84rem; margin: 0 0 12px; }
.an-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: .78rem; color: var(--edge-text-3); }
.an-legend i { display: inline-block; width: 14px; height: 10px; border-radius: 2px; vertical-align: middle; margin-right: 5px; }

/* Data table */
.an-table-wrap { overflow: auto; max-height: min(78vh, 1100px); max-height: min(78dvh, 1100px); overscroll-behavior-x: contain; border: 1px solid var(--edge-line); border-radius: var(--edge-r-lg); background: var(--edge-surface-1); }
.an-table { font-size: .86rem; border-collapse: separate; border-spacing: 0; }
.an-table th { position: sticky; top: 0; z-index: 2; background: var(--edge-surface-2); cursor: default; }
.an-table th.sortable { cursor: pointer; user-select: none; }
.an-table th.sortable:hover { color: var(--edge-text); }
.an-table th.asc::after { content: " ▲"; font-size: .6rem; color: var(--edge-link); }
.an-table th.desc::after { content: " ▼"; font-size: .6rem; color: var(--edge-link); }
.an-table td, .an-table th { padding: 9px 12px; white-space: nowrap; }
.an-table td.num, .an-table th.num { text-align: right; font-family: var(--edge-mono); font-variant-numeric: tabular-nums; }
.an-table .sticky { position: sticky; left: 0; z-index: 1; background: var(--edge-surface-1); box-shadow: 1px 0 0 var(--edge-line); }
.an-table th.sticky { z-index: 3; background: var(--edge-surface-2); }
.an-table tbody tr { cursor: pointer; }
.an-table tbody tr:hover td { background: var(--edge-surface-2); }
.an-table tbody tr:hover td.sticky { background: var(--edge-surface-2); }
.an-table tbody tr:focus-visible { outline: 2px solid var(--edge-volt); outline-offset: -2px; }
.an-player { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.an-player img, .an-face { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; object-position: top; background: var(--edge-surface-3); flex: none; }
.an-face { display: inline-grid; place-items: center; font: 700 .7rem/1 var(--edge-mono); color: var(--edge-text-3); }
.an-player strong { display: block; font-weight: 600; font-size: .9rem; }
.an-player small { display: block; color: var(--edge-text-3); font-size: .74rem; }
.pos { display: inline-grid; place-items: center; min-width: 26px; height: 18px; padding: 0 5px; border-radius: 4px; font: 700 .62rem/1 var(--edge-mono); letter-spacing: .04em; color: #0a0d0b; background: var(--p, #9aa59c); margin-left: 6px; vertical-align: middle; }
.pos.QB { --p: #ff8fa3; } .pos.RB { --p: #5ee6a0; } .pos.WR { --p: #8cc8ff; } .pos.TE { --p: #ffc56b; }
.inj { display: inline-block; margin-left: 6px; padding: 1px 5px; border-radius: 4px; font: 700 .6rem/1.4 var(--edge-mono); background: var(--edge-down-soft); color: var(--edge-down); }

/* Heat map: percentile within position (or across teams). */
.h3 { background: rgba(61, 220, 132, .22) !important; } .h2 { background: rgba(61, 220, 132, .13) !important; } .h1 { background: rgba(61, 220, 132, .06) !important; }
.c3 { background: rgba(255, 97, 80, .24) !important; } .c2 { background: rgba(255, 97, 80, .14) !important; } .c1 { background: rgba(255, 97, 80, .06) !important; }
:root[data-theme="light"] .h3 { background: rgba(11, 133, 70, .24) !important; } :root[data-theme="light"] .h2 { background: rgba(11, 133, 70, .15) !important; } :root[data-theme="light"] .h1 { background: rgba(11, 133, 70, .07) !important; }
:root[data-theme="light"] .c3 { background: rgba(196, 47, 29, .22) !important; } :root[data-theme="light"] .c2 { background: rgba(196, 47, 29, .13) !important; } :root[data-theme="light"] .c1 { background: rgba(196, 47, 29, .06) !important; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .h3 { background: rgba(11, 133, 70, .24) !important; } :root:not([data-theme="dark"]) .h2 { background: rgba(11, 133, 70, .15) !important; } :root:not([data-theme="dark"]) .h1 { background: rgba(11, 133, 70, .07) !important; } :root:not([data-theme="dark"]) .c3 { background: rgba(196, 47, 29, .22) !important; } :root:not([data-theme="dark"]) .c2 { background: rgba(196, 47, 29, .13) !important; } :root:not([data-theme="dark"]) .c1 { background: rgba(196, 47, 29, .06) !important; } }
.rk { display: block; font-size: .66rem; color: var(--edge-text-3); font-family: var(--edge-mono); }

/* Player dialog */
.an-dialog { width: min(980px, calc(100vw - 24px)); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--edge-line-strong); border-radius: var(--edge-r-xl); background: var(--edge-bg); color: var(--edge-text); box-shadow: var(--edge-shadow); }
.an-dialog::backdrop { background: rgba(0, 0, 0, .62); backdrop-filter: blur(3px); }
.an-dialog__head { position: sticky; top: 0; z-index: 2; display: flex; gap: 16px; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--edge-line); background: var(--edge-bg); }
.an-dialog__head img, .an-dialog__head .an-face { width: 64px; height: 64px; }
.an-dialog__head h2 { margin: 0; font-size: clamp(1.4rem, 3vw, 2rem); }
.an-dialog__head .close { margin-left: auto; }
.an-dialog__head > div { min-width: 0; }
@media (max-width: 520px) {
  .an-dialog { width: calc(100vw - 16px); }
  .an-dialog__head { gap: 12px; padding: 12px 14px; align-items: flex-start; }
  .an-dialog__head img, .an-dialog__head .an-face { width: 44px; height: 44px; }
  .an-dialog__head h2 { font-size: 1.2rem; }
  .an-dialog__head p { font-size: .82rem; }
  .an-dialog__body { padding: 16px 14px 22px; gap: 16px; }
  .an-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .an-kpis > div { padding: 12px; }
  .an-kpis dd { font-size: 1.15rem; }
}
.an-dialog__body { padding: 20px 24px 28px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.an-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 0; background: var(--edge-surface-1); border: 1px solid var(--edge-line); border-radius: var(--edge-r-lg); overflow: hidden; }
.an-kpis > div { padding: 14px 16px; display: grid; gap: 4px; box-shadow: 1px 0 0 var(--edge-line), 0 1px 0 var(--edge-line); }
.an-kpis dt { font: 600 .66rem/1 var(--edge-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--edge-text-3); }
.an-kpis dd { margin: 0; font: 600 1.35rem/1 var(--edge-mono); letter-spacing: -.03em; }
.an-kpis dd small { font-size: .72rem; color: var(--edge-text-3); letter-spacing: 0; margin-left: 4px; }
.an-statgroups { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.an-statgroup { border: 1px solid var(--edge-line); border-radius: var(--edge-r-md); padding: 12px 14px; background: var(--edge-surface-1); }
.an-statgroup h3 { font: 600 .7rem/1 var(--edge-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--edge-text-3); margin: 0 0 8px; }
.an-statgroup dl { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; font-size: .86rem; }
.an-statgroup dt { color: var(--edge-text-2); }
.an-statgroup dd { margin: 0; text-align: right; font-family: var(--edge-mono); padding: 0 6px; border-radius: 4px; }
.an-chart { width: 100%; height: auto; display: block; }
.an-chart text { fill: var(--edge-text-3); font: 500 10px var(--edge-mono); }
.an-chart .bar { fill: var(--edge-volt); }
.an-chart .bar.dim { fill: var(--edge-line-strong); }
.an-chart .grid { stroke: var(--edge-line); stroke-width: 1; }
.an-chart .line { fill: none; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.an-chart .avg { stroke: var(--edge-text-3); stroke-dasharray: 4 4; }

/* Compare */
.cmp-pick { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: end; margin-bottom: 18px; }
.cmp-pick label { margin: 0; display: grid; gap: 6px; }
.cmp-grid { display: grid; gap: 6px; }
.cmp-row { display: grid; grid-template-columns: 1fr 150px 1fr; gap: 12px; align-items: center; font-size: .9rem; }
.cmp-row .lbl { text-align: center; color: var(--edge-text-2); font-size: .8rem; }
.cmp-side { display: flex; align-items: center; gap: 8px; font-family: var(--edge-mono); }
.cmp-side.a { justify-content: flex-end; }
.cmp-bar { height: 10px; border-radius: 5px; background: var(--edge-line-strong); min-width: 2px; }
.cmp-side.win .cmp-bar { background: var(--edge-volt); }
.cmp-side.win b { color: var(--edge-text); }
.cmp-side b { font-weight: 600; color: var(--edge-text-2); min-width: 56px; }
.cmp-side.a b { text-align: right; }
@media (max-width: 640px) { .cmp-pick { grid-template-columns: 1fr; } .cmp-row { grid-template-columns: 1fr 96px 1fr; } }

/* Game center: list */
.gc-weeks { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.gc-weeks::-webkit-scrollbar { display: none; }
.gc-weeks .chip { flex: none; min-height: 34px; padding: 0 12px; font-family: var(--edge-mono); font-size: .8rem; }
.gc-day { font: 600 .72rem/1 var(--edge-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--edge-text-3); margin: 28px 0 12px; }
.gc-day:first-of-type { margin-top: 20px; }
.gc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 12px; }
.gc-card { display: flex; flex-direction: column; gap: 12px; padding: 16px 18px; border: 1px solid var(--edge-line); border-radius: var(--edge-r-lg); background: var(--edge-surface-1); color: var(--edge-text); text-decoration: none; transition: border-color .15s, background-color .15s, transform .15s; }
.gc-card:hover { border-color: var(--edge-line-strong); background: var(--edge-surface-2); }
.gc-card__top { display: flex; justify-content: space-between; align-items: center; font: 500 .74rem/1 var(--edge-mono); color: var(--edge-text-3); }
.gc-team { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; }
.gc-team img, .gc-logo { width: 30px; height: 30px; object-fit: contain; }
.gc-logo { display: inline-grid; place-items: center; border-radius: 8px; background: var(--edge-surface-3); font: 700 .62rem/1 var(--edge-mono); }
.gc-team strong { font-weight: 600; }
.gc-team small { color: var(--edge-text-3); font-size: .76rem; margin-left: 6px; }
.gc-team .score { font: 700 1.3rem/1 var(--edge-mono); }
.gc-team.lost { opacity: .55; }
.gc-card__foot { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 10px; margin-top: auto; border-top: 1px solid var(--edge-line); }
.gc-card__foot .badge { height: 22px; font-size: .64rem; }
.gc-live { color: var(--edge-down); }

/* Game center: detail */
.gd-back { margin: 4px 0 18px; }
.gd-hero { position: relative; overflow: hidden; border-radius: var(--edge-r-xl); border: 1px solid var(--edge-line); background: var(--edge-surface-1); padding: clamp(20px, 4vw, 36px); }
.gd-hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, color-mix(in srgb, var(--away, #333) 30%, transparent), transparent 42%, transparent 58%, color-mix(in srgb, var(--home, #333) 30%, transparent)); pointer-events: none; }
.gd-hero > * { position: relative; }
.gd-matchup { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: center; }
.gd-side { display: flex; align-items: center; gap: 14px; }
.gd-side.home { flex-direction: row-reverse; text-align: right; }
.gd-side img, .gd-side .gc-logo { width: clamp(52px, 8vw, 84px); height: clamp(52px, 8vw, 84px); }
.gd-side h2 { margin: 0; font-size: clamp(1.3rem, 3.4vw, 2.4rem); }
.gd-side p { margin: 4px 0 0; color: var(--edge-text-2); font: 500 .82rem/1.3 var(--edge-mono); }
.gd-mid { text-align: center; display: grid; gap: 6px; justify-items: center; }
.gd-mid .gd-score { white-space: nowrap; }
.gd-score { font: 800 clamp(2rem, 6vw, 3.4rem)/1 var(--edge-mono); letter-spacing: -.04em; }
.gd-status { font: 600 .74rem/1 var(--edge-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--edge-text-3); }
.gd-facts { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--edge-line); color: var(--edge-text-2); font-size: .86rem; }
.gd-facts span { display: inline-flex; gap: 6px; align-items: center; }
.gd-facts svg { width: 16px; height: 16px; }
@media (max-width: 640px) { .gd-matchup { grid-template-columns: 1fr; } .gd-side.home { flex-direction: row; text-align: left; } .gd-mid { justify-items: start; text-align: left; } }
.gd-nav { position: sticky; top: var(--edge-header-h); z-index: 20; background: color-mix(in srgb, var(--edge-bg) 92%, transparent); backdrop-filter: blur(10px); margin: 18px 0 8px; }
.gd-section { scroll-margin-top: calc(var(--edge-header-h) + 60px); margin-top: clamp(28px, 3.5vw, 40px); }
.gd-section > h2 { font-size: clamp(1.2rem, 2.4vw, 1.6rem); margin-bottom: 4px; }
.gd-section > .an-note { margin-bottom: 14px; }
.gd-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 860px) { .gd-two { grid-template-columns: 1fr; } }
.gd-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.gd-tile { padding: 16px 18px; border-radius: var(--edge-r-lg); border: 1px solid var(--edge-line); background: var(--edge-surface-1); display: grid; gap: 6px; align-content: start; }
.gd-tile dt { font: 600 .66rem/1 var(--edge-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--edge-text-3); }
.gd-tile dd { margin: 0; font: 650 clamp(1.15rem, 1.6vw, 1.4rem)/1.15 var(--edge-mono); letter-spacing: -.03em; overflow-wrap: anywhere; }
.gd-tile small { color: var(--edge-text-3); font-size: .78rem; }
.gd-prob { display: flex; height: 34px; border-radius: 8px; overflow: hidden; font: 700 .8rem/34px var(--edge-mono); }
.gd-prob span { padding: 0 10px; white-space: nowrap; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); min-width: 0; overflow: hidden; }
.gd-prob span:last-child { text-align: right; }

/* Offense vs defense */
.mx { border: 1px solid var(--edge-line); border-radius: var(--edge-r-lg); background: var(--edge-surface-1); overflow: hidden; }
.mx__head { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--edge-line); background: var(--edge-surface-2); }
.mx__head div { display: flex; align-items: center; gap: 10px; font-weight: 650; }
.mx__head div:last-child { justify-content: flex-end; text-align: right; }
.mx__head img { width: 26px; height: 26px; }
.mx__head small { display: block; color: var(--edge-text-3); font: 500 .7rem/1.2 var(--edge-mono); letter-spacing: .06em; text-transform: uppercase; }
.mx__row { display: grid; grid-template-columns: 1fr minmax(120px, 1.4fr) 1fr; gap: 10px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--edge-line); }
.mx__row:first-of-type { border-top: 0; }
.mx__val { font: 600 .95rem/1.1 var(--edge-mono); }
.mx__val small { display: block; color: var(--edge-text-3); font-size: .68rem; margin-top: 2px; }
.mx__val.right { text-align: right; }
.mx__mid { display: grid; gap: 6px; text-align: center; }
.mx__mid span { font-size: .78rem; color: var(--edge-text-2); }
.mx__edge { position: relative; height: 8px; border-radius: 4px; background: var(--edge-surface-3); }
.mx__edge i { position: absolute; top: 0; bottom: 0; border-radius: 4px; }
.mx__edge::after { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; background: var(--edge-bg); }
.mx__verdict { padding: 12px 16px; border-top: 1px solid var(--edge-line); font-size: .86rem; color: var(--edge-text-2); background: var(--edge-surface-2); }
.mx__verdict strong { color: var(--edge-text); }

/* Fantasy allowed */
.fpa { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.fpa > div { border-radius: var(--edge-r-md); padding: 12px; border: 1px solid var(--edge-line); display: grid; gap: 4px; }
.fpa b { font: 700 1.2rem/1 var(--edge-mono); }
.fpa small { font-size: .72rem; color: var(--edge-text-2); }
@media (max-width: 520px) { .fpa { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Players to watch, injuries, form */
.gd-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.gd-list li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: var(--edge-r-md); background: var(--edge-surface-1); border: 1px solid var(--edge-line); }
.gd-list li a { color: var(--edge-text); text-decoration: none; font-weight: 600; }
.gd-list li a:hover { text-decoration: underline; }
.gd-list small { display: block; color: var(--edge-text-3); font-size: .76rem; margin-top: 2px; }
.gd-list .num { font: 600 .92rem/1.1 var(--edge-mono); text-align: right; }
.gd-list .num small { font-family: var(--edge-ui); }
.gd-form { display: flex; gap: 6px; flex-wrap: wrap; }
.gd-form span { display: inline-grid; place-items: center; min-width: 74px; padding: 6px 8px; border-radius: 6px; font: 600 .74rem/1.25 var(--edge-mono); text-align: center; background: var(--edge-surface-2); }
.gd-form span.W { background: var(--edge-up-soft); color: var(--edge-up); } .gd-form span.L { background: var(--edge-down-soft); color: var(--edge-down); }
.gd-compare { display: grid; gap: 4px; }
.gd-compare div { display: grid; grid-template-columns: 1fr minmax(120px, 1.4fr) 1fr; gap: 8px; padding: 8px 12px; border-radius: 6px; font-size: .86rem; }
.gd-compare div:nth-child(odd) { background: var(--edge-surface-1); }
.gd-compare b { font-family: var(--edge-mono); font-weight: 600; }
.gd-compare b:last-child { text-align: right; }
.gd-compare span { text-align: center; color: var(--edge-text-2); }
.gd-scoring li { grid-template-columns: 64px 1fr auto; }
.skeleton-block { height: 120px; }
.an-tabs .chip[aria-selected="true"] { background: var(--edge-text); border-color: var(--edge-text); color: var(--edge-bg); }
.an-row > select, .an-row > input[type="search"] { width: auto !important; flex: 0 1 260px; }
.gd-section h3 { margin: 22px 0 10px; }
.gd-section .card h3, .gd-two > div > h3:first-child { margin-top: 0; }
.an-chart .marker { stroke: var(--edge-text); stroke-width: 2.5; stroke-linecap: round; }

/* Landscape phones: the dialog takes the whole screen and its header scrolls away. */
@media (orientation: landscape) and (max-height: 520px) {
  .an-dialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  .an-dialog__head { position: static; padding: 12px max(16px, env(safe-area-inset-left)); }
  .an-table-wrap { max-height: calc(100dvh - 24px); }
  .gd-nav { top: 0; margin-block: 12px 4px; }
}

/* Card hover lift for the game list and insight cards. */
.gc-card { transition: border-color .18s var(--edge-ease), background-color .18s var(--edge-ease), transform .18s var(--edge-ease); }
.gc-card:hover { transform: translateY(-2px); }
