/* Separate scorebook sections on the lobby's olive / Barlow foundation. */
#statistics-insights { --chart-score: #edba5c; margin-top: 36px; border: 0; background: transparent; box-shadow: none; overflow: visible; }
#statistics-insights > .section-heading { padding: 0 0 20px; }
#statistics-insights > .section-heading h2 { font-family: var(--display); font-size: 32px; }
.insights-body { padding: 0; min-width: 0; }
.insights-controls { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, .55fr) auto; gap: 20px; align-items: end; padding: 20px 24px; margin-bottom: 24px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); }
.insights-controls label { position: relative; display: grid; gap: 8px; min-width: 0; font-size: 13px; color: var(--muted); }
.insights-controls label::after { content: ''; position: absolute; right: 16px; bottom: 22px; width: 6px; height: 6px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg); pointer-events: none; }
.insights-controls select { appearance: none; -webkit-appearance: none; box-sizing: border-box; width: 100%; min-width: 0; height: 48px; min-height: 48px; padding: 10px 34px 10px 14px; background: var(--bg); color: var(--text); border: 1px solid #56635b; border-radius: 4px; font: inherit; font-size: 16px; line-height: 24px; text-overflow: ellipsis; }
.insights-controls select:focus-visible, .insights-body summary:focus-visible, .insights-table-wrap:focus-visible, .insights-body button:focus-visible, .insight-chart-canvas:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 4px; }
#insights-content { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
.insight-block { --insight-accent: #edba5c; --insight-tint: #363322; min-width: 0; padding: 24px; margin: 0; border: 1px solid #445047; border-top: 3px solid var(--insight-accent); border-radius: 7px; background: var(--paper); box-shadow: 0 8px 24px #00000012; }
.insight-block[data-tone='blue'] { --insight-accent: #91bdd8; --insight-tint: #26363d; }
.insight-block[data-tone='copper'] { --insight-accent: #e5ac89; --insight-tint: #3a3029; }
.insight-block[data-tone='green'] { --insight-accent: #b7d28c; --insight-tint: #303a28; }
.insight-block[data-tone='mint'] { --insight-accent: #8fd0be; --insight-tint: #263b33; }
.insight-block[data-tone='violet'] { --insight-accent: #bcafe0; --insight-tint: #34303e; }
.insight-block[data-tone='sage'] { --insight-accent: #b0c8a5; --insight-tint: #303b2d; }
.insight-block[data-tone='steel'] { --insight-accent: #b3c2b9; --insight-tint: #2c3530; }
.insight-block[data-tone='plum'] { --insight-accent: #d4a9cf; --insight-tint: #382b37; }
.insight-block[data-tone='gold'] { --insight-accent: #e8c870; --insight-tint: #3a3423; }
.insight-block[data-tone='teal'] { --insight-accent: #86c7c3; --insight-tint: #233836; }
.insight-block[data-tone='rose'] { --insight-accent: #d9b08f; --insight-tint: #3a2f27; }
.insight-profile { min-height: 48px; }
.insight-form, .insight-clutch, .insight-activity, .insight-achievements { grid-column: 1 / -1; }
.insight-sides th:nth-child(2) { color: #b8dfff; }
.insight-sides th:nth-child(3) { color: #ffc0b6; }
.insight-rival-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.insight-rival-cards .insight-name { display: block; min-height: 44px; margin: 10px 0 6px; padding: 0; border: 0; background: none; color: var(--insight-accent); font: 700 30px/1.15 var(--display); text-align: left; overflow-wrap: anywhere; cursor: pointer; }
.insight-rival-cards .insight-name:hover { text-decoration: underline; text-underline-offset: 4px; }
.insight-duo { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0 8px; min-width: 0; }
.insight-duo-plus { color: var(--muted); }
.insight-team { flex-wrap: nowrap; gap: 0 6px; white-space: nowrap; }
.insight-team-member { display: inline-flex; align-items: center; min-width: 0; }
.insight-team-comma { color: var(--muted); }
.insights-table .insight-game { display: inline-flex; align-items: center; min-height: 44px; color: var(--insight-accent); text-decoration: underline; text-underline-offset: 4px; }
.insights-table .insight-game:hover { color: var(--text); }
/* A fixed table frame: it never rubber-bands and its headings stay; whole rows, names included, slide sideways on one line. */
.insights-table-wrap.insight-fixed-table { position: relative; isolation: isolate; overscroll-behavior-x: none; }
.insights-table-wrap.insight-fixed-table.scroll-capped { overscroll-behavior-y: none; }
.insight-fixed-table .insights-table { border-collapse: separate; border-spacing: 0; }
.insight-fixed-table .insights-table thead th { position: sticky; top: 0; z-index: 1; }
.insight-fixed-table .insights-table :is(th, td) { white-space: nowrap; }
.insight-fixed-table .insights-table :is(th, td):first-child { max-width: none; overflow-wrap: normal; }
.insight-teams .insights-table :is(th, td):last-child { text-align: left; }
/* Wide screens have room for the whole table: long names wrap instead of adding a sideways scroll. */
@media (min-width: 1101px) {
  .insight-teams .insights-table td:first-child { white-space: normal; }
  .insight-teams .insight-team { flex-wrap: wrap; white-space: normal; }
  .insight-teams .insight-team-member { white-space: nowrap; }
}
.insight-badge-count { margin: 0 0 16px; color: var(--muted); font-size: 13px; }
.insight-badge-count strong { color: var(--insight-accent); font: 700 30px/1 var(--display); margin-right: 4px; }
.insight-badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.insight-badge { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 12px; align-items: start; min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 5px; background: #19201c; }
.insight-badge-earned { border-color: #6b6038; background: var(--insight-tint); }
.insight-badge-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: var(--muted); background: #252e29; }
.insight-badge-earned .insight-badge-mark { color: #1c2320; background: var(--insight-accent); }
.insight-badge-mark svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.insight-badge h4 { margin: 0 0 4px; color: var(--text); }
.insight-badge p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.insight-badge .insight-badge-state { margin-top: 6px; color: var(--text); }
.insight-badge-earned .insight-badge-state { color: var(--insight-accent); }
.insight-badge progress { appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 6px; margin-top: 8px; border: 0; border-radius: 3px; overflow: hidden; background: #344337; accent-color: var(--insight-accent); }
.insight-badge progress::-webkit-progress-bar { background: #344337; }
.insight-badge progress::-webkit-progress-value { background: var(--insight-accent); border-radius: 3px; }
.insight-badge progress::-moz-progress-bar { background: var(--insight-accent); border-radius: 3px; }
.insight-block-heading { display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: start; gap: 12px; padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.insight-section-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 5px; color: var(--insight-accent); background: var(--insight-tint); }
.insight-section-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.insights-body h3 { margin: 0; font-family: var(--display); font-size: 25px; font-weight: 700; line-height: 1.15; color: var(--text); }
.insights-body h4 { font-size: 14px; line-height: 1.5; margin: 0 0 8px; font-weight: 500; }
.insight-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; }
.insight-title-row h3 { min-width: 0; overflow-wrap: anywhere; }
.insight-scope { display: inline-block; box-sizing: border-box; min-width: 0; max-width: 100%; padding: 5px 8px; border: 1px solid var(--line); border-radius: 4px; color: var(--insight-accent); font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.insight-note, .insight-empty { font-size: 13px; color: var(--muted); line-height: 1.65; overflow-wrap: anywhere; margin: 9px 0 0; max-width: 78ch; }
.insight-block-heading .insight-note { margin-top: 6px; }
.insight-empty { min-height: 64px; padding: 16px 0; }
.insight-form-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; margin-bottom: 24px; }
.insight-form-summary > div { display: grid; gap: 7px; padding-left: 18px; border-left: 2px solid var(--line); min-width: 0; }
.insight-form-summary strong { font: 700 37px/1.1 var(--display); color: var(--text); overflow-wrap: anywhere; }
.insight-form-summary > div:nth-child(3) { border-color: var(--chart-score); }
.insight-form-summary > div:nth-child(3) strong { color: var(--chart-score); }
.insight-form-summary span { color: var(--muted); font-size: 12px; line-height: 1.5; }
.insight-chart-frame { margin-top: 14px; border-radius: 5px; background: #151c18; padding: 16px 12px 8px; }
.insight-chart-canvas { position: relative; min-height: 250px; border-radius: 3px; touch-action: pan-y; }
.insight-chart { display: block; width: 100%; height: auto; overflow: visible; }
.insight-chart text { fill: #b4c0b7; stroke: none; font: 12px Barlow, sans-serif; }
.insight-chart .insight-axis { stroke: #8b9b8f; stroke-width: 1; }
.insight-chart .insight-gridline { stroke: #344337; stroke-width: 1; stroke-dasharray: 3 5; }
.insight-chart .insight-series { fill: none; stroke-width: 2.7; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.insight-chart .insight-zero-line { stroke: #8b9b8f; stroke-width: 1; }
.insight-series-score { stroke: var(--chart-score); }
.insight-dot-score { fill: var(--chart-score); stroke: #151c18; stroke-width: 1.4; }
.insight-chart .insight-crosshair { stroke: #bec9c0; stroke-width: 1; stroke-dasharray: 4 4; }
.insight-chart-tooltip { box-sizing: border-box; position: absolute; z-index: 2; top: 12px; max-width: min(220px, calc(100% - 24px)); padding: 10px 14px; border: 1px solid #647265; border-radius: 5px; background: #202c24; color: var(--text); box-shadow: 0 5px 18px #0005; pointer-events: none; font-size: 13px; line-height: 1.6; }
.insight-chart-tooltip strong { display: block; font-weight: 600; margin-bottom: 3px; }
.insight-tooltip-score { color: var(--chart-score); font-weight: 600; }
.insight-chart-help { margin: 0 0 0 32px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.insights-table-wrap { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-color: var(--insight-accent) var(--bg); }
.insights-table { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
.insights-table th, .insights-table td { text-align: right; border-bottom: 1px solid var(--line); padding: 13px 12px; }
.insights-table th { font-size: 12px; color: #bdc7bf; font-weight: 500; white-space: nowrap; background: var(--insight-tint); }
.insights-table th:first-child, .insights-table td:first-child { text-align: left; overflow-wrap: anywhere; min-width: 105px; max-width: 240px; }
.insights-table td:not(:first-child) { white-space: nowrap; }
.insights-table tbody tr:last-child td { border-bottom: 0; }
.insights-table .insight-name { display: inline-flex; align-items: center; color: var(--text); border: 0; background: none; font: inherit; padding: 6px 0; text-align: left; min-height: 44px; overflow-wrap: anywhere; text-decoration: none; cursor: pointer; }
.insights-table .insight-name:hover { color: var(--insight-accent); }
.insight-table-hint { margin: 10px 0 0; font-size: 12px; color: var(--insight-accent); line-height: 1.6; }
.insights-body details { min-width: 0; }
.insights-body summary { min-height: 44px; padding: 15px 0 8px; color: var(--insight-accent, var(--muted)); cursor: pointer; font-size: 13px; }
.insight-records { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.insight-record { min-width: 0; }
.insight-record + .insight-record { padding-left: 18px; border-left: 1px solid var(--line); }
.insight-record strong { display: block; color: var(--insight-accent); font: 700 46px/1.1 var(--display); overflow-wrap: anywhere; margin: 14px 0; }
.insight-record p { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 6px 0; overflow-wrap: anywhere; }
.insight-record a { display: inline-flex; align-items: center; min-height: 44px; color: var(--insight-accent); font-size: 13px; text-decoration: underline; text-underline-offset: 4px; }
.insight-weekdays { display: grid; gap: 16px; margin-top: 4px; }
.insight-weekday { display: grid; grid-template-columns: 42px minmax(0, 1fr) 90px; align-items: center; gap: 16px; font-size: 13px; }
.insight-weekday progress { appearance: none; -webkit-appearance: none; width: 100%; height: 10px; border: 0; border-radius: 3px; overflow: hidden; accent-color: var(--insight-accent); background: #344337; }
.insight-weekday progress::-webkit-progress-bar { background: #344337; }
.insight-weekday progress::-webkit-progress-value { background: var(--insight-accent); border-radius: 3px; }
.insight-weekday progress::-moz-progress-bar { background: var(--insight-accent); border-radius: 3px; }
.insight-weekday strong { text-align: right; color: var(--insight-accent); font-size: 14px; font-weight: 500; }
.insight-coverage { grid-column: 1 / -1; max-width: none; padding: 16px 20px; margin: 0; background: #202a22; border-left: 3px solid #7f9585; border-radius: 4px; }
.insight-methodology { grid-column: 1 / -1; padding: 0 4px; color: var(--muted); }
.insight-methodology p { font-size: 13px; line-height: 1.7; max-width: 90ch; }
@media (max-width: 1100px) {
  #insights-content { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 620px) {
  #statistics-insights { margin-top: 28px; }
  #statistics-insights > .section-heading h2 { font-size: 29px; }
  .insights-controls { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 18px; margin-bottom: 20px; }
  #insights-content { gap: 20px; }
  .insight-block { padding: 18px 14px; }
  .insight-block-heading { grid-template-columns: 36px minmax(0, 1fr); gap: 10px; padding-bottom: 16px; margin-bottom: 18px; }
  .insight-section-icon { width: 36px; height: 36px; }
  .insight-section-icon svg { width: 20px; height: 20px; }
  .insights-body h3 { font-size: 24px; }
  .insight-form-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; }
  .insight-form-summary > div { padding-left: 12px; }
  .insight-form-summary strong { font-size: 32px; }
  .insight-chart-frame { padding: 14px 0 8px; }
  .insight-chart-help { margin-left: 14px; padding-right: 10px; }
  .insight-records { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .insight-record, .insight-record + .insight-record { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 16px; padding: 0 0 16px; border-left: 0; border-bottom: 1px solid var(--line); }
  .insight-record:last-child { border-bottom: 0; padding-bottom: 0; }
  .insight-record h4 { align-self: center; }
  .insight-record strong { grid-column: 2; grid-row: 1 / 4; font-size: 42px; margin: 0; align-self: center; }
  .insight-record p, .insight-record a { grid-column: 1; margin: 0; }
  .insights-table th, .insights-table td { padding: 10px 9px; }
  .insight-weekday { grid-template-columns: 30px minmax(0, 1fr) 72px; gap: 10px; }
  .insight-rival-cards { grid-template-columns: minmax(0, 1fr); }
  .insight-rival-cards .insight-record { display: block; }
  .insight-badges { grid-template-columns: minmax(0, 1fr); }
}
/* Performans: the place beside the name, a signed change with an arrow. */
.insight-ranked { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.insight-rank { flex-shrink: 0; min-width: 2.4ch; color: var(--text); font: 700 19px/1 var(--display); font-variant-numeric: tabular-nums; }
.insight-change { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; font-weight: 700; font-variant-numeric: tabular-nums; }
.insight-change[data-trend='up'] { color: #a8d79a; }
.insight-change[data-trend='down'] { color: #f0a59b; }
.insight-change[data-trend='flat'] { color: #bdc7bf; }
.insight-change-arrow { font-size: 10px; }
.insight-progress .insights-table td { font-variant-numeric: tabular-nums; }
/* Narrow screens: a row is its place and name over three labelled values, as the ranking's rows are; no sideways scroll. */
@media (max-width: 640px) {
  .insights-table-stacked, .insights-table-stacked tbody { display: block; }
  .insights-table-stacked thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .insights-table-stacked tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 10px; padding: 6px 0 12px; border-bottom: 1px solid var(--line); }
  .insights-table-stacked tr:last-child { border-bottom: 0; }
  .insights-table-stacked td { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; padding: 0; border: 0; text-align: left; font-size: 15px; }
  .insights-table-stacked td:first-child { grid-column: 1 / -1; max-width: none; min-width: 0; margin-bottom: 4px; }
  .insights-table-stacked td:not(:first-child)::after { content: attr(data-label); color: #bdc7bf; font-size: 11px; font-weight: 400; }
  .insights-table-stacked .insight-change { justify-content: flex-start; }
  .insights-table-stacked .insight-ranked { width: 100%; }
}
