:root {
  color-scheme: light;
  --ink: #18202a;
  --muted: #5b6675;
  --paper: #f7f5ef;
  --surface: #ffffff;
  --line: #d9ded8;
  --red: #b42335;
  --teal: #126b6f;
  --gold: #d3952f;
  --green: #2e7d50;
  --strong-surface: #18202a;
  --strong-text: #f7f5ef;
  --shadow: 0 18px 45px rgba(24, 32, 42, 0.12);
}

.theme-dark {
  color-scheme: dark;
  --ink: #edf2f4;
  --muted: #aeb9c3;
  --paper: #101418;
  --surface: #171d23;
  --line: #2b3540;
  --red: #ef5869;
  --teal: #45c3bd;
  --gold: #f1b85b;
  --green: #66c28b;
  --strong-surface: #232d36;
  --strong-text: #f4f7f8;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px clamp(20px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
}

.brand,
.nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand {
  text-decoration: none;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--strong-surface);
  color: var(--strong-text);
  font-size: 0.85rem;
}

.nav a,
.link-button {
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
}

.link-button {
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.75fr);
  align-items: center;
  gap: clamp(32px, 7vw, 92px);
  min-height: calc(100vh - 80px);
  padding: clamp(40px, 7vw, 96px) clamp(20px, 5vw, 72px);
}

.hero-copy {
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 20px;
  font-size: clamp(2.5rem, 7vw, 5.7rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(1.8rem, 3vw, 3rem);
  line-height: 1.05;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.05rem;
}

.lede {
  max-width: 620px;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 18px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.button.primary {
  background: var(--red);
  color: white;
}

.button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.button.secondary {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.button.full {
  width: 100%;
}

.scoreboard-panel {
  background: var(--strong-surface);
  color: var(--strong-text);
  border-radius: 8px;
  padding: clamp(20px, 4vw, 34px);
  box-shadow: var(--shadow);
}

.score-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.score-row span {
  color: #dbe1de;
  line-height: 1.3;
}

.score-row strong {
  color: var(--gold);
  font-size: 2.6rem;
}

.process-list {
  display: grid;
  gap: 10px;
  margin-top: 26px;
}

.process-list span {
  border-left: 4px solid var(--green);
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
}

.section,
.dashboard {
  padding: clamp(40px, 7vw, 84px) clamp(20px, 5vw, 72px);
}

.support-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  margin-top: clamp(34px, 6vw, 70px);
  border: 1px solid color-mix(in srgb, var(--gold) 42%, var(--line));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--gold) 13%, var(--surface)), var(--surface));
  box-shadow: 0 10px 26px rgba(24, 32, 42, 0.06);
  padding: clamp(20px, 4vw, 32px);
}

.support-band h2 {
  margin-bottom: 8px;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.support-band p:not(.eyebrow) {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.support-band .button {
  white-space: nowrap;
}

.section-heading {
  max-width: 720px;
  margin-bottom: 28px;
}

.feature-grid,
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.feature-card,
.metric-card,
.auth-card,
.workbench {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 26px rgba(24, 32, 42, 0.06);
}

.feature-card {
  padding: 22px;
}

.feature-card p,
.workbench p,
.hint {
  color: var(--muted);
  line-height: 1.55;
}

.rating-deep-dive {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(22px, 4vw, 42px);
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 26px rgba(24, 32, 42, 0.06);
  padding: clamp(22px, 4vw, 36px);
}

.rating-deep-dive h2 {
  margin-bottom: 14px;
  font-size: clamp(1.7rem, 3vw, 2.6rem);
}

.rating-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  margin: 0 0 18px;
  border-radius: 8px;
  background: var(--strong-surface);
  color: var(--strong-text);
  font-size: clamp(1.15rem, 2.4vw, 1.75rem);
  font-weight: 950;
  line-height: 1;
  padding: 0 16px;
}

.rating-deep-dive p {
  color: var(--muted);
  line-height: 1.6;
}

.rating-deep-dive p:last-child {
  margin-bottom: 0;
}

.rating-method-grid {
  display: grid;
  gap: 14px;
}

.rating-method-grid article {
  border-left: 4px solid var(--teal);
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface) 94%, var(--paper));
  padding: 16px;
}

.rating-method-grid h3 {
  margin-bottom: 6px;
}

.rating-method-grid p {
  margin-bottom: 0;
}

.auth-shell {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 80px);
  padding: 32px 20px;
}

.auth-card {
  width: min(100%, 430px);
  padding: 30px;
}

.auth-card h1,
.dashboard h1 {
  font-size: 2.2rem;
  line-height: 1.1;
}

label {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--ink);
  font-weight: 750;
}

input {
  width: 100%;
  min-height: 46px;
  border: 1px solid #cbd3ce;
  background: var(--surface);
  color: var(--ink);
  border-radius: 8px;
  padding: 0 13px;
  font: inherit;
}

input:focus {
  outline: 3px solid rgba(18, 107, 111, 0.2);
  border-color: var(--teal);
}

.hint {
  margin: 16px 0 0;
  font-size: 0.9rem;
}

.auth-intro {
  margin: 0 0 18px;
  line-height: 1.5;
}

.flash-wrap {
  padding: 16px clamp(20px, 5vw, 72px) 0;
}

.flash {
  max-width: 720px;
  margin: 0 auto;
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.flash.error {
  border-color: rgba(180, 35, 53, 0.35);
  color: var(--red);
}

.flash.success {
  border-color: rgba(46, 125, 80, 0.35);
  color: var(--green);
}

.dashboard-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.user-list {
  display: grid;
  gap: 10px;
}

.user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
}

.user-row strong {
  display: block;
  overflow-wrap: anywhere;
}

.user-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 750;
}

.user-row form {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.metric-card {
  padding: 20px;
}

.metric-card span {
  display: block;
  min-height: 42px;
  color: var(--muted);
  font-weight: 700;
}

.metric-card strong {
  font-size: 2.4rem;
}

.workbench {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 1fr);
  gap: 24px;
  margin-top: 18px;
  padding: 26px;
}

.task-list {
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.8;
}

.upload-panel,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 26px rgba(24, 32, 42, 0.06);
}

.upload-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 1fr);
  gap: 24px;
  margin-top: 18px;
  padding: 26px;
}

.upload-panel p,
.empty-state p,
.game-date,
.game-file {
  color: var(--muted);
  line-height: 1.55;
}

.upload-panel code {
  font-size: 0.92em;
}

.upload-form {
  display: grid;
  align-content: center;
  gap: 8px;
}

.upload-progress {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.upload-progress[hidden] {
  display: none;
}

.upload-progress-track {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 82%, var(--paper));
}

.upload-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), var(--gold), var(--red));
  transition: width 650ms ease;
}

.upload-progress p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

input[type="file"] {
  padding: 11px 13px;
  background: color-mix(in srgb, var(--surface) 94%, var(--paper));
}

.games-section {
  margin-top: 34px;
}

.section-heading.compact {
  margin-bottom: 16px;
}

.section-heading.compact h2 {
  font-size: 1.8rem;
}

.game-list {
  display: grid;
  gap: 14px;
}

.game-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
  box-shadow: 0 10px 26px rgba(24, 32, 42, 0.06);
}

.game-card-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  min-width: 0;
  border-radius: 8px;
  padding: 6px;
  color: inherit;
  text-decoration: none;
  transition: border-color 140ms ease, transform 140ms ease;
}

.game-card:hover,
.game-card:focus-within {
  border-color: var(--teal);
}

.game-card-main:hover,
.game-card-main:focus-visible {
  transform: translateY(-1px);
}

.game-menu {
  position: relative;
}

.game-menu summary {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

.game-menu summary::-webkit-details-marker {
  display: none;
}

.game-menu summary:hover,
.game-menu[open] summary {
  background: color-mix(in srgb, var(--surface) 78%, var(--teal));
  color: var(--ink);
}

.game-menu-panel {
  position: absolute;
  top: 42px;
  right: 0;
  z-index: 5;
  min-width: 150px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 6px;
}

.danger-menu-button {
  width: 100%;
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--red);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  text-align: left;
  padding: 0 10px;
}

.danger-menu-button:hover,
.danger-menu-button:focus-visible {
  background: rgba(180, 35, 53, 0.08);
}

.game-file,
.game-date {
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.game-card h3 {
  margin-bottom: 6px;
  font-size: 1.25rem;
}

.game-score {
  display: grid;
  grid-template-columns: auto auto auto;
  align-items: center;
  gap: 12px;
  min-width: 210px;
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--strong-surface);
  color: var(--strong-text);
  text-align: center;
}

.game-score span {
  color: var(--gold);
  font-size: 2rem;
  font-weight: 900;
}

.game-score strong {
  color: #dbe1de;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.empty-state {
  padding: 24px;
}

.back-link {
  display: inline-flex;
  margin-bottom: 22px;
  color: var(--teal);
  font-weight: 800;
  text-decoration: none;
}

.game-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px;
  margin-bottom: 28px;
}

.game-hero h1 {
  max-width: 900px;
  font-size: clamp(2rem, 5vw, 4rem);
}

.game-score.large {
  min-width: 270px;
}

.game-score.large span {
  font-size: 2.8rem;
}

.roster-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.game-tabs > input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tab-list {
  display: inline-flex;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 4px;
  margin-bottom: 20px;
}

.tab-list label,
.tab-link {
  min-height: 40px;
  margin: 0;
  border-radius: 6px;
  padding: 9px 16px;
  color: var(--muted);
  cursor: pointer;
  font-weight: 850;
  text-decoration: none;
}

#tab-dashboard:checked ~ .tab-list label[for="tab-dashboard"],
#tab-score:checked ~ .tab-list label[for="tab-score"],
#tab-jammers:checked ~ .tab-list label[for="tab-jammers"],
#tab-blockers:checked ~ .tab-list label[for="tab-blockers"],
#tab-lineups:checked ~ .tab-list label[for="tab-lineups"],
#tab-ratings:checked ~ .tab-list label[for="tab-ratings"],
#tab-penalties:checked ~ .tab-list label[for="tab-penalties"],
#tab-rosters:checked ~ .tab-list label[for="tab-rosters"],
.tab-link.active {
  background: var(--strong-surface);
  color: var(--strong-text);
}

.tab-panel {
  display: none;
}

#tab-dashboard:checked ~ .dashboard-tab,
#tab-score:checked ~ .score-tab,
#tab-jammers:checked ~ .jammers-tab,
#tab-blockers:checked ~ .blockers-tab,
#tab-lineups:checked ~ .lineups-tab,
#tab-ratings:checked ~ .ratings-tab,
#tab-penalties:checked ~ .penalties-tab,
#tab-rosters:checked ~ .rosters-tab {
  display: block;
}

.game-summary-grid,
.insight-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.summary-card,
.insight-card,
.score-chart-panel,
.score-insight-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 26px rgba(24, 32, 42, 0.06);
}

.summary-card {
  padding: 20px;
}

.summary-card span {
  display: block;
  min-height: 42px;
  color: var(--muted);
  font-weight: 750;
}

.summary-card strong {
  font-size: 2.5rem;
}

.insight-grid {
  margin-top: 18px;
}

.insight-card {
  padding: 20px;
}

.insight-card h2 {
  margin-bottom: 8px;
  font-size: 1.8rem;
}

.insight-card p:last-child,
.score-insight-card p {
  color: var(--muted);
  margin-bottom: 0;
}

.score-chart-panel {
  padding: 22px;
}

.score-chart-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 10px;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

.chart-legend span::before {
  content: "";
  width: 22px;
  height: 4px;
  border-radius: 999px;
}

.legend-home::before {
  background: var(--red);
}

.legend-away::before {
  background: #2563eb;
}

.score-chart {
  width: 100%;
  min-height: 280px;
  overflow: visible;
}

.chart-grid {
  stroke: var(--line);
  stroke-width: 1;
}

.chart-axis {
  stroke: var(--muted);
  stroke-width: 1.5;
}

.period-break {
  stroke: var(--muted);
  stroke-dasharray: 5 5;
}

.score-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
  transition: opacity 140ms ease, stroke-width 140ms ease;
}

.home-line {
  stroke: var(--red);
}

.away-line {
  stroke: #2563eb;
}

.score-chart:hover .score-line {
  opacity: 0.35;
}

.score-chart .score-line:hover {
  opacity: 1;
  stroke-width: 7;
}

.score-point {
  stroke: var(--surface);
  stroke-width: 2;
  transition: r 140ms ease, opacity 140ms ease;
}

.home-point {
  fill: var(--red);
}

.away-point {
  fill: #2563eb;
}

.score-point-hit {
  fill: transparent;
  cursor: crosshair;
}

.score-point-hit:hover + .score-point,
.score-point:hover {
  r: 8;
}

.chart-label,
.period-label {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.x-label {
  text-anchor: middle;
}

.y-label {
  text-anchor: end;
}

.period-label {
  text-anchor: middle;
}

.score-insights {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.lineup-filter-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--teal);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 26px rgba(24, 32, 42, 0.06);
  padding: 18px;
}

.lineup-filter-banner h2 {
  margin-bottom: 6px;
  font-size: 1.5rem;
}

.lineup-filter-banner p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.lineup-section-grid {
  display: grid;
  gap: 18px;
}

.lineup-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 26px rgba(24, 32, 42, 0.06);
}

.lineup-table-wrap {
  overflow-x: auto;
}

.lineup-table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
}

.lineup-table th,
.lineup-table td {
  border-bottom: 1px solid var(--line);
  padding: 9px 8px;
  text-align: left;
  vertical-align: middle;
}

.lineup-table thead th {
  background: color-mix(in srgb, var(--surface) 86%, var(--paper));
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.lineup-table tbody tr:last-child th,
.lineup-table tbody tr:last-child td {
  border-bottom: 0;
}

.lineup-table tbody tr.has-penalty {
  background: color-mix(in srgb, var(--red) 4%, var(--surface));
}

.jam-label {
  display: inline-flex;
  min-width: 54px;
  color: var(--ink);
  font-weight: 900;
}

.numeric-cell {
  color: var(--ink);
  font-weight: 900;
  text-align: right;
}

.flag-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 24px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 900;
}

.flag-good {
  background: color-mix(in srgb, var(--green) 22%, var(--surface));
  color: var(--green);
}

.flag-info {
  background: color-mix(in srgb, var(--teal) 18%, var(--surface));
  color: var(--teal);
}

.flag-warn {
  background: color-mix(in srgb, var(--gold) 24%, var(--surface));
  color: var(--ink);
}

.flag-muted {
  background: color-mix(in srgb, var(--muted) 16%, var(--surface));
  color: var(--muted);
}

.lineup-skater {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 190px;
  min-height: 30px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: inherit;
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
  padding: 4px 6px;
}

.lineup-skater span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

a.lineup-skater:hover,
a.lineup-skater:focus-visible {
  border-color: var(--teal);
  background: rgba(18, 107, 111, 0.08);
}

.lineup-skater.penalized {
  border-color: color-mix(in srgb, var(--red) 35%, var(--line));
  background: color-mix(in srgb, var(--red) 9%, var(--surface));
}

.lineup-skater small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  min-height: 22px;
  border-radius: 999px;
  background: var(--red);
  color: white;
  font-size: 0.72rem;
  font-weight: 900;
}

.lineup-empty,
.lineup-empty-state {
  color: var(--muted);
  font-weight: 750;
}

.lineup-empty-state {
  padding: 20px;
  text-align: center;
}

.rating-explainer,
.rating-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 26px rgba(24, 32, 42, 0.06);
}

.rating-explainer {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(0, 1fr);
  gap: 22px;
  margin-bottom: 18px;
  padding: 22px;
}

.rating-explainer h2 {
  margin-bottom: 8px;
  font-size: 1.8rem;
}

.rating-explainer p,
.rating-explainer li {
  color: var(--muted);
  line-height: 1.55;
}

.rating-explainer ol {
  margin: 0;
  padding-left: 22px;
}

.rating-grid {
  display: grid;
  gap: 18px;
}

.rating-panel {
  overflow: hidden;
}

.rating-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  gap: 18px;
  padding: 18px;
}

.rating-columns h3 {
  margin-bottom: 12px;
}

.rating-list,
.vtar-list {
  display: grid;
  gap: 8px;
}

.rating-row,
.vtar-row {
  display: grid;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
  padding: 8px 10px;
}

.rating-row {
  grid-template-columns: 58px minmax(0, 1fr) repeat(4, auto);
}

.vtar-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.rating-row:hover,
.rating-row:focus-visible,
.vtar-row:hover,
.vtar-row:focus-visible {
  border-color: var(--teal);
  background: rgba(18, 107, 111, 0.08);
}

.rating-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 50px;
  min-height: 34px;
  border-radius: 8px;
  background: var(--strong-surface);
  color: var(--strong-text);
  font-weight: 950;
}

.rating-name {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 900;
}

.rating-row span:not(.rating-score):not(.rating-name),
.vtar-row small {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.vtar-row strong {
  color: var(--teal);
  font-size: 1.05rem;
}

.blocker-grid {
  display: grid;
  gap: 18px;
}

.blocker-section {
  padding: 18px;
}

.blocker-section h3,
.pack-columns h3 {
  margin-bottom: 12px;
}

.blocker-table-wrap {
  overflow-x: auto;
}

.blocker-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
}

.blocker-table th,
.blocker-table td {
  border-bottom: 1px solid var(--line);
  padding: 9px 8px;
  text-align: right;
  white-space: nowrap;
}

.blocker-table th:first-child,
.blocker-table td:first-child {
  min-width: 210px;
  text-align: left;
  white-space: normal;
}

.blocker-table thead th {
  background: color-mix(in srgb, var(--surface) 86%, var(--paper));
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.blocker-table tbody th a {
  color: inherit;
  font-weight: 900;
  text-decoration: none;
}

.blocker-table tbody th a:hover,
.blocker-table tbody th a:focus-visible {
  color: var(--teal);
}

.pack-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding: 0 18px 18px;
}

.pack-list {
  display: grid;
  gap: 10px;
}

.pack-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 96%, var(--paper));
  padding: 12px;
}

.pack-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pack-card-heading strong {
  color: var(--ink);
}

.pack-card-heading span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--teal) 16%, var(--surface));
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 900;
  padding: 0 9px;
}

.pack-card p {
  margin: 0;
  color: var(--ink);
  font-weight: 900;
}

.pack-card small {
  color: var(--muted);
  font-weight: 750;
  line-height: 1.45;
}

.jammer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.jammer-chart-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  align-items: start;
  gap: 18px;
  padding: 20px;
}

.jammer-pie {
  aspect-ratio: 1;
  width: min(100%, 190px);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: inset 0 0 0 18px var(--surface);
}

.jammer-table {
  display: grid;
  gap: 8px;
}

.jammer-row {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) repeat(4, auto);
  align-items: center;
  gap: 10px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
  padding: 8px 10px;
}

.jammer-row:hover,
.jammer-row:focus-visible {
  border-color: var(--teal);
  background: rgba(18, 107, 111, 0.08);
}

.jammer-swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.jammer-name {
  min-width: 0;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.jammer-row span:not(.jammer-name):not(.jammer-swatch) {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  white-space: nowrap;
}

.score-insight-card {
  display: grid;
  grid-template-columns: minmax(240px, 0.45fr) minmax(0, 1fr);
  gap: 18px;
  padding: 20px;
}

.score-insight-card h3 {
  font-size: 1.35rem;
}

.lineup-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.lineup-columns div {
  display: grid;
  gap: 6px;
  align-content: start;
}

.lineup-columns strong {
  color: var(--ink);
}

.lineup-columns span {
  color: var(--muted);
  font-size: 0.92rem;
}

.penalty-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.penalty-list {
  display: grid;
}

.penalty-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 56px 92px;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}

.penalty-row:last-child {
  border-bottom: 0;
}

.penalty-row.has-penalties {
  background: color-mix(in srgb, var(--surface) 94%, var(--paper));
}

.penalty-row:hover,
.penalty-row:focus-visible {
  background: rgba(18, 107, 111, 0.08);
}

.penalty-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 34px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--red) 18%, var(--surface));
  color: var(--red);
  font-weight: 900;
}

.jammer-count {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  text-align: right;
}

.analysis-notes {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 26px rgba(24, 32, 42, 0.06);
  padding: 22px;
}

.analysis-note-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.analysis-note-grid article,
.lineup-impact-grid article {
  border-top: 3px solid var(--teal);
  padding-top: 12px;
}

.analysis-note-grid p,
.lineup-impact-grid p {
  color: var(--muted);
  line-height: 1.55;
}

.lineup-impact-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.lineup-impact-grid article {
  display: grid;
  align-content: start;
  gap: 8px;
}

.lineup-impact-grid h3 {
  margin-bottom: 4px;
}

.lineup-impact-grid p {
  margin-bottom: 0;
}

.lineup-impact-grid strong {
  color: var(--ink);
}

.lineup-impact-grid span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
}

.roster-panel,
.skater-profile {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 26px rgba(24, 32, 42, 0.06);
}

.roster-panel {
  overflow: hidden;
}

.roster-heading {
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.roster-heading h2 {
  margin-bottom: 6px;
  font-size: 1.45rem;
}

.roster-heading p,
.skater-profile p {
  margin-bottom: 0;
  color: var(--muted);
}

.skater-list {
  display: grid;
}

.skater-main {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.skater-row {
  min-width: 0;
  min-height: 54px;
  border-bottom: 1px solid var(--line);
}

.skater-main {
  min-width: 0;
  color: inherit;
  text-decoration: none;
  padding: 10px 16px;
}

.skater-row:last-child {
  border-bottom: 0;
}

.skater-row.played {
  background: color-mix(in srgb, var(--surface) 94%, var(--paper));
}

.skater-main:hover,
.skater-main:focus-visible {
  background: rgba(18, 107, 111, 0.08);
}

.roster-warning {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-left: 8px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--gold) 24%, var(--surface));
  color: var(--ink);
  font-size: 0.74rem;
  font-weight: 900;
  padding: 0 8px;
}

.roster-merge-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 0 16px 12px 100px;
}

.roster-merge-form select,
.roster-merge-form button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.roster-merge-form select {
  min-width: 0;
  padding: 0 10px;
}

.roster-merge-form button {
  background: var(--strong-surface);
  color: var(--strong-text);
  cursor: pointer;
  font-weight: 850;
  padding: 0 12px;
}

.skater-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  min-height: 34px;
  border-radius: 8px;
  background: var(--strong-surface);
  color: var(--strong-text);
  font-weight: 900;
}

.skater-row:not(.played) .skater-number {
  background: var(--line);
  color: var(--muted);
}

.settings-page {
  max-width: 980px;
}

.settings-panel {
  display: grid;
  gap: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 26px rgba(24, 32, 42, 0.06);
  padding: 26px;
}

.settings-panel p,
.toggle-row small {
  color: var(--muted);
  line-height: 1.55;
}

.glossary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.glossary-card {
  display: grid;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 26px rgba(24, 32, 42, 0.06);
  padding: 22px;
}

.glossary-card h2 {
  margin-bottom: 10px;
  font-size: 1.35rem;
}

.glossary-card p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
}

.toggle-row span {
  display: grid;
  gap: 4px;
}

.toggle-row small {
  font-weight: 500;
}

.toggle-row input[type="checkbox"] {
  appearance: none;
  flex: 0 0 auto;
  width: 58px;
  height: 32px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  cursor: pointer;
  padding: 3px;
}

.toggle-row input[type="checkbox"]::before {
  content: "";
  display: block;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--muted);
  transition: transform 140ms ease, background 140ms ease;
}

.toggle-row input[type="checkbox"]:checked {
  background: color-mix(in srgb, var(--teal) 28%, var(--surface));
  border-color: var(--teal);
}

.toggle-row input[type="checkbox"]:checked::before {
  transform: translateX(24px);
  background: var(--teal);
}

.skater-name {
  min-width: 0;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.skater-count {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
  justify-self: end;
  white-space: nowrap;
}

.skater-profile {
  max-width: 760px;
  padding: 28px;
}

.skater-profile h1 {
  font-size: clamp(2rem, 5vw, 4rem);
}

.profile-number {
  color: var(--red);
}

.player-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.player-hero h1 {
  max-width: 900px;
  font-size: clamp(2rem, 5vw, 4rem);
}

.player-hero p {
  color: var(--muted);
  line-height: 1.55;
}

.player-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 8px;
}

.player-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 8px;
  background: var(--strong-surface);
  color: var(--strong-text);
  font-weight: 900;
  padding: 0 12px;
}

.player-summary-grid,
.player-profile-grid {
  display: grid;
  gap: 16px;
}

.player-summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
}

.player-profile-grid {
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1fr);
}

.radar-card,
.player-rates-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 26px rgba(24, 32, 42, 0.06);
  padding: 22px;
}

.radar-chart {
  width: 100%;
  max-width: 360px;
  display: block;
  margin: 10px auto 0;
  overflow: visible;
}

.radar-ring {
  fill: none;
  stroke: var(--line);
  stroke-width: 1.4;
}

.radar-ring.inner {
  stroke-dasharray: 4 4;
}

.radar-axis {
  stroke: var(--line);
  stroke-width: 1;
}

.radar-area {
  fill: color-mix(in srgb, var(--teal) 34%, transparent);
  stroke: var(--teal);
  stroke-width: 3;
}

.radar-label {
  fill: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-anchor: middle;
  dominant-baseline: middle;
}

.rate-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.rate-list div {
  border-top: 3px solid var(--teal);
  padding-top: 12px;
}

.rate-list dt {
  color: var(--muted);
  font-weight: 800;
}

.rate-list dd {
  margin: 4px 0 0;
  font-size: 1.6rem;
  font-weight: 900;
}

.profile-insight-grid {
  margin-top: 12px;
}

.profile-context-grid {
  display: grid;
  grid-template-columns: 1.2fr repeat(2, minmax(220px, 0.8fr));
  gap: 14px;
}

.profile-context-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
}

.role-split {
  display: grid;
  gap: 12px;
}

.role-split div {
  display: grid;
  grid-template-columns: minmax(74px, 0.6fr) 52px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.role-split span,
.compact-stat-list dt {
  color: var(--muted);
  font-weight: 850;
}

.role-split strong,
.compact-stat-list dd {
  color: var(--strong-text);
  font-weight: 950;
}

.role-meter {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.role-meter span {
  display: block;
  height: 100%;
  min-width: 4px;
  max-width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--red), var(--teal));
}

.compact-stat-list {
  display: grid;
  gap: 10px;
  margin: 12px 0 0;
}

.compact-stat-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.compact-stat-list div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.compact-stat-list dd {
  margin: 0;
  font-size: 1.25rem;
}

.appearance-list {
  display: grid;
  gap: 10px;
}

.appearance-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) repeat(6, auto);
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
  padding: 12px;
}

.appearance-row:hover,
.appearance-row:focus-visible {
  border-color: var(--teal);
  background: rgba(18, 107, 111, 0.08);
}

.appearance-row span {
  font-weight: 800;
}

.appearance-row small {
  display: block;
  color: var(--muted);
  font-weight: 700;
  margin-top: 2px;
}

.identity-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(280px, 1fr);
  gap: 18px;
}

.alias-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.alias-list span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 94%, var(--paper));
  font-weight: 850;
  padding: 0 10px;
}

.alias-list small {
  color: var(--muted);
  font-weight: 700;
}

.alias-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.alias-form label {
  margin: 0;
}

@media (max-width: 900px) {
  .hero,
  .workbench,
  .upload-panel {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .feature-grid,
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .game-hero,
  .player-hero,
  .lineup-filter-banner,
  .identity-grid,
  .glossary-grid,
  .roster-grid,
  .penalty-grid,
  .player-summary-grid,
  .player-profile-grid,
  .game-summary-grid,
  .insight-grid,
  .score-insight-card,
  .analysis-note-grid,
  .lineup-impact-grid,
  .jammer-grid,
  .jammer-chart-layout,
  .rating-explainer,
  .rating-columns,
  .rating-deep-dive,
  .pack-columns {
    grid-template-columns: 1fr;
  }

  .support-band {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .support-band .button {
    width: 100%;
  }

  .profile-context-grid {
    grid-template-columns: 1fr;
  }

  .lineup-columns {
    grid-template-columns: 1fr;
  }

  .player-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .lineup-filter-banner {
    align-items: flex-start;
    flex-direction: column;
  }

  .player-tags {
    justify-content: start;
  }
}

@media (max-width: 620px) {
  .site-header,
  .dashboard-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .feature-grid,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .score-row strong {
    font-size: 2rem;
  }

  .user-row {
    grid-template-columns: 1fr;
  }

  .user-row form {
    justify-content: flex-start;
  }

  .game-card,
  .game-card-main,
  .game-score {
    grid-template-columns: 1fr;
  }

  .game-card {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .game-score {
    min-width: 0;
  }

  .skater-main {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .roster-merge-form {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .roster-merge-form {
    padding: 0 16px 12px;
  }

  .roster-merge-form select,
  .roster-merge-form button {
    grid-column: 2;
  }

  .skater-count {
    grid-column: 2;
  }

  .penalty-row {
    grid-template-columns: 58px minmax(0, 1fr) auto;
  }

  .jammer-row {
    grid-template-columns: 14px minmax(0, 1fr) auto;
  }

  .rating-row,
  .vtar-row {
    grid-template-columns: 1fr;
  }

  .rating-score {
    justify-self: start;
  }

  .jammer-row span:nth-last-child(-n + 3) {
    grid-column: 2 / 4;
    justify-self: start;
  }

  .jammer-count {
    grid-column: 2 / 4;
    text-align: left;
  }

  .rate-list,
  .alias-form,
  .appearance-row {
    grid-template-columns: 1fr;
  }

  .tab-list {
    display: grid;
    width: 100%;
  }

  .score-chart-heading {
    display: grid;
  }

  .chart-legend {
    justify-content: start;
  }
}
