/* Common Ground Cup 4 tournament summary */
:root {
  --ink: #192638;
  --muted: #657487;
  --line: #dce3e9;
  --paper: #eef2f5;
  --panel: #fff;
  --blue: #2f6fb0;
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: Manrope, sans-serif; }
h1, h2, p { margin: 0; }
a { color: inherit; text-underline-offset: 3px; }
.report-shell { width: min(1420px, calc(100% - 40px)); margin: 0 auto; padding: 36px 0 54px; }
.report-header { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.eyebrow { color: #8a5e19; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.header-meta { display: flex; align-items: center; gap: 10px; }
.header-meta span + span { padding-left: 10px; border-left: 1px solid #cdbf9f; color: var(--muted); letter-spacing: .04em; }
h1 { margin-top: 5px; font-size: clamp(32px, 5vw, 58px); letter-spacing: -.045em; }
h2 { font-size: 19px; }
.source-links { display: flex; gap: 16px; }
.source-link { color: var(--blue); font-size: 12px; font-weight: 800; }
.chart-panel { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.chart-panel { padding: 19px; }
.chart-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.chart-heading p { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.data-status { margin-top: 16px; padding: 11px 13px; border: 1px solid #e6d7ad; border-radius: 5px; color: #67501d; background: #fff9e8; font-size: 12px; line-height: 1.5; }
.chart-scroll { margin-top: 15px; overflow-x: auto; }
#survival-chart { display: block; width: 100%; min-width: 1100px; height: auto; }
.grid-line { stroke: #e6ebef; stroke-width: 1; }
.stage-line { stroke: #d9e0e6; stroke-width: 1; }
.stage-line.cut { stroke: #1f2e3d; stroke-width: 2; }
.axis-label, .stage-label, .survivor-count { fill: var(--muted); font-size: 12px; }
.stage-label { fill: var(--ink); font-weight: 800; }
.survivor-count { font-size: 10px; }
.area-band { opacity: .88; cursor: crosshair; transition: opacity 120ms ease; }
.area-band:hover, .area-band.highlighted, .area-band.selected { opacity: 1; stroke: #fff; stroke-width: 2; }
.chart-hovering .area-band:not(.highlighted):not(.selected) { opacity: .28; }
.edge-label-group { cursor: pointer; }
.edge-leader { fill: none; stroke: #8795a4; stroke-width: 1; pointer-events: none; vector-effect: non-scaling-stroke; }
.edge-label { fill: var(--ink); font-size: 11px; font-weight: 800; pointer-events: none; }
.edge-pip { pointer-events: none; }
.edge-hit { fill: transparent; cursor: pointer; }
.hover-rule { opacity: 0; stroke: #182838; stroke-width: 1.5; stroke-dasharray: 4 4; pointer-events: none; }
.hover-rule.visible { opacity: .7; }
.alive-panel { margin-top: 14px; border-top: 1px solid var(--line); }
.alive-empty { min-height: 66px; display: grid; align-content: center; gap: 2px; padding: 13px 8px 0; }
.alive-empty span { color: var(--muted); font-size: 12px; }
.alive-panel.visible { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.alive-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 13px 15px; border-left: 4px solid var(--active-color); background: #f7f9fb; }
.alive-heading h3 { margin: 0; font-size: 16px; }
.alive-heading p { margin-top: 3px; color: var(--muted); font-size: 12px; }
.alive-title-pips { display: flex; align-items: center; gap: 4px; }
.alive-title-pips h3 { margin-left: 3px; }
.alive-close { width: 32px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); background: #fff; font-size: 22px; line-height: 1; cursor: pointer; }
.alive-close:hover { color: var(--ink); border-color: #aeb9c5; }
.alive-table-wrap { overflow-x: auto; }
.alive-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.alive-table th { padding: 9px 12px; color: var(--muted); background: #fbfcfd; font-size: 10px; font-weight: 800; text-align: left; text-transform: uppercase; }
.alive-table td { padding: 9px 12px; border-top: 1px solid #e8edf2; }
.alive-table tbody tr:hover { background: #f7f9fb; }
.player-name { font-weight: 800; }
.archetype-cell { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.archetype-cell > span { margin-left: 3px; }
.survivor-band-cell, .rank-cell, .tiebreak-cell, .record-cell, .final-cell { font-variant-numeric: tabular-nums; white-space: nowrap; }
.survivor-band-cell, .rank-cell { font-weight: 800; }
.survivor-band-cell small { color: var(--muted); font-size: 11px; font-weight: 700; }
.tiebreak-cell { color: #536274; }
.alive-table th:last-child, .deck-cell { text-align: center; }
.deck-cell { white-space: nowrap; }
.deck-link { padding: 0; border: 0; color: var(--blue); background: transparent; cursor: pointer; font: inherit; font-weight: 800; }
.deck-link:hover { text-decoration: underline; }
.no-decks { padding: 24px !important; color: var(--muted); text-align: center; }
.rank-note { margin: 0; padding: 10px 13px; border-top: 1px solid var(--line); color: var(--muted); background: #fbfcfd; font-size: 11px; line-height: 1.45; }
.analysis-panel { margin-top: 14px; padding: 19px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.analysis-heading h2 { margin-top: 4px; }
.analysis-heading > div > p:last-child { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.deck-pane { min-width: 0; margin-top: 18px; border: 1px solid var(--line); background: #f9fafb; }
.deck-pane-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.deck-pane-title { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
select { max-width: 280px; min-height: 34px; padding: 5px 32px 5px 9px; border: 1px solid #c8ced1; border-radius: 5px; background: #fff; color: var(--ink); font: inherit; font-size: 12px; }
.deck-pane-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; padding: 14px; }
.consensus-section h3 { margin: 0 0 7px; font-size: 11px; text-transform: uppercase; }
.card-type-group + .card-type-group { margin-top: 12px; }
.card-type-head { display: flex; justify-content: space-between; gap: 12px; padding: 6px 8px; background: #e6e9eb; font-size: 10px; font-weight: 800; }
.card-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) 50px; gap: 8px; align-items: center; min-height: 27px; border-bottom: 1px solid #e3e6e7; font-size: 11px; }
.card-row:last-child, .exact-card-row:last-child { border-bottom: 0; }
.avg { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.prevalence { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.sideboard-column { min-width: 0; }
.view-lists-button { margin-top: 16px; padding: 7px 0; border: 0; background: transparent; color: var(--blue); cursor: pointer; font: inherit; font-size: 11px; font-weight: 800; }
.view-lists-button::before { content: "\25B8"; display: inline-block; margin-right: 6px; transition: transform 120ms ease; }
.view-lists-button[aria-expanded="true"]::before { transform: rotate(90deg); }
.decklists-panel { grid-column: 1 / -1; padding-top: 14px; border-top: 1px solid var(--line); }
.decklists-panel[hidden] { display: none; }
.decklists-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.decklists-head label { display: grid; gap: 5px; color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.decklists-meta { color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.decklist-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.exact-card-row { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 8px; align-items: center; min-height: 27px; border-bottom: 1px solid #e3e6e7; font-size: 11px; }
.usage-list { margin-top: 18px; padding: 18px; border: 1px solid var(--line); background: #f9fafb; columns: 2; column-gap: 30px; }
.usage-row { display: grid; grid-template-columns: minmax(0, 1fr) 55px 60px; gap: 8px; break-inside: avoid; min-height: 29px; border-bottom: 1px solid #dfe3e4; font-size: 11px; }
.usage-copies, .usage-decks { text-align: right; font-variant-numeric: tabular-nums; }
.usage-copies { font-weight: 800; }
.usage-decks { color: var(--muted); }
.loading-note { grid-column: 1 / -1; padding: 28px; color: var(--muted); font-size: 12px; text-align: center; }
.error { padding: 60px 20px; color: #a62f27; font-weight: 800; text-align: center; }

@media (max-width: 720px) {
  .report-shell { width: min(100% - 24px, 1420px); padding-top: 22px; }
  .report-header, .chart-heading { align-items: stretch; flex-direction: column; }
  .header-meta { align-items: flex-start; flex-direction: column; gap: 4px; }
  .header-meta span + span { padding-left: 0; border-left: 0; }
  .source-links { justify-content: space-between; }
  .chart-panel { padding: 14px 10px 12px; }
  .alive-table { min-width: 1050px; }
  .deck-pane-body, .decklist-grid { grid-template-columns: 1fr; }
  .usage-list { columns: 1; }
}
