
@font-face {
  font-family: 'Big Shoulders Display';
  font-style: normal;
  font-weight: 700 900;
  font-display: swap;
  src: url('/fonts/big-shoulders-display-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Instrument Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/instrument-sans-latin.woff2') format('woff2');
}

:root {
  --red: #D7141E;
  --bt: #1F4FBF;
  --ink: #0F1B2D;
  --paper: #ECEFEE;
  --surface: #F7F8F7;
  --white: #FFFFFF;
  --rule: #D3D9D8;
  --rule-strong: #B9C1C0;
  --bar-neutral: #A9B3B2;
  --muted: #66727A;
  --muted-light: #919BA1;
  --body: #3C4852;
  --quote: #1C2733;
  --tint-red: #FBE9EA;
  --display: 'Big Shoulders Display', 'Arial Narrow', sans-serif;
  --text: 'Instrument Sans', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { text-wrap: pretty; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-feature-settings: 'tnum';
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid var(--bt);
  outline-offset: 2px;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px 96px;
}

/* Header: Brann red band */
.site-header { background: var(--red); color: #fff; }
.site-header__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  min-height: 72px;
}
.brand { display: flex; align-items: baseline; gap: 12px; margin-right: auto; padding: 14px 0; }
.brand__name {
  font-family: var(--display);
  font-weight: 900;
  font-size: 34px;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
.brand__sub { font-size: 13px; color: rgba(255,255,255,0.75); }

.nav { display: flex; align-items: center; gap: 4px; overflow-x: auto; padding: 10px 0; }
.nav a {
  display: flex;
  align-items: center;
  padding: 0 16px;
  min-height: 40px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
}
.nav a:hover { color: #fff; background: rgba(255,255,255,0.12); }
.nav a.is-active { background: #fff; color: var(--red); }

/* Shared bits */
.back-link {
  display: inline-block;
  margin-top: 28px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}
.back-link:hover { color: var(--ink); }
.eyebrow { font-size: 15px; color: var(--muted); margin-top: 10px; }

/* Sesong: the duel */
.duel { padding: 56px 0 0; }
.duel__board { display: grid; grid-template-columns: 1fr 1fr; border-radius: 6px; overflow: hidden; color: #fff; }
.duel__side { padding: 24px 30px 32px; display: flex; flex-direction: column; }
.duel__side--bt { background: var(--bt); }
.duel__side--ba { background: var(--red); text-align: right; align-items: flex-end; }
.duel__paper { font-size: 16px; font-weight: 600; }
.duel__score {
  font-family: var(--display);
  font-weight: 900;
  font-size: 148px;
  line-height: 0.9;
  margin-top: 8px;
}
.duel__sub { font-size: 14px; color: rgba(255,255,255,0.8); margin-top: 16px; }

.duel__facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  margin-bottom: 64px;
}
.duel__fact { background: var(--ink); color: #fff; padding: 18px 28px; display: flex; align-items: baseline; gap: 14px; }
.duel__fact:first-child { border-bottom-left-radius: 6px; }
.duel__fact:last-child { border-bottom-right-radius: 6px; justify-content: flex-end; }
.duel__fact-value { font-family: var(--display); font-weight: 800; font-size: 44px; line-height: 1; }
.duel__fact-label { font-size: 14px; color: rgba(255,255,255,0.72); }

/* Panels */
.panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 48px; }
.panel__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 3px solid var(--ink);
}
.panel__header h2, .kfk-header h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 36px;
  line-height: 1;
  font-weight: 800;
  text-transform: uppercase;
}
.panel__unit { font-size: 13px; color: var(--muted); }
.panel__caption { font-size: 13px; color: var(--muted); margin-top: 14px; line-height: 1.5; }
.panel__empty { font-size: 14px; color: var(--muted); padding: 14px 0; }

/* Shared row styling so the two side-by-side panels line up row-for-row. */
.rank-row, .bias-row { display: flex; align-items: center; gap: 14px; padding: 12px 6px; border-bottom: 1px solid var(--rule); }
.rank-row:hover, .bias-row:hover { background: var(--surface); }
.rank-row__no, .bias-row__no { font-family: var(--display); font-weight: 700; font-size: 18px; color: var(--muted-light); width: 28px; flex-shrink: 0; }
.rank-row__body, .bias-row__identity { flex: 1; min-width: 0; }
.rank-row__name, .bias-row__name { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-row__meta, .bias-row__meta { font-size: 13px; color: var(--muted); }
.rank-row__bar { width: 96px; height: 10px; background: var(--rule); border-radius: 5px; position: relative; flex-shrink: 0; overflow: hidden; }
.rank-row__bar-fill { position: absolute; inset: 0 auto 0 0; background: var(--ink); border-radius: 5px; }
.rank-row__value, .bias-row__value { font-family: var(--display); font-size: 26px; font-weight: 800; width: 52px; text-align: right; flex-shrink: 0; }

.bias-plot { width: 150px; height: 20px; position: relative; flex-shrink: 0; }
.bias-plot::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--rule-strong); }
.bias-plot__bar { position: absolute; top: 5px; height: 10px; border-radius: 2px; }

/* Page header (Kamper / Spillere) */
.page-header { padding: 56px 0 28px; }
.page-header h1, .kamp-header__title, .identity__name {
  margin: 0;
  font-family: var(--display);
  font-size: 96px;
  line-height: 0.88;
  font-weight: 900;
  text-transform: uppercase;
}
.not-found__text { font-size: 17px; color: var(--body); }
.not-found__text a { text-decoration: underline; text-underline-offset: 3px; }

/* Årets spiller (Spillere) */
.awards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin: 56px 0 40px; align-items: start; }
.award { background: var(--bt); color: #fff; border-radius: 6px; padding: 20px 22px 14px; display: flex; flex-direction: column; gap: 14px; }
.award--ba { background: var(--red); }
.award__label { font-size: 15px; font-weight: 600; color: rgba(255,255,255,0.85); }
.award__leader { display: flex; flex-direction: column; gap: 6px; }
.award__body { display: flex; align-items: baseline; gap: 10px; }
.award__no { font-family: var(--display); font-weight: 700; font-size: 20px; color: rgba(255,255,255,0.6); }
.award__name { font-family: var(--display); font-size: 40px; font-weight: 900; text-transform: uppercase; line-height: 0.95; }
.award__leader:hover .award__name { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 4px; }
.award__footer { display: flex; align-items: baseline; gap: 10px; }
.award__value { font-family: var(--display); font-size: 64px; font-weight: 900; line-height: 1; }
.award__sub { font-size: 14px; color: rgba(255,255,255,0.8); }
.award__rest { list-style: none; margin: 0; padding: 0; border-top: 1px solid rgba(255,255,255,0.3); }
.award__rest-row { display: flex; align-items: baseline; gap: 12px; padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,0.18); }
.award__rest-row:hover .award__rest-name { text-decoration: underline; }
.award__rest li:last-child .award__rest-row { border-bottom: 0; }
.award__rest-rank { font-family: var(--display); font-weight: 700; font-size: 18px; color: rgba(255,255,255,0.6); width: 14px; flex-shrink: 0; }
.award__rest-name { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.award__rest-games { font-size: 13px; color: rgba(255,255,255,0.65); white-space: nowrap; flex-shrink: 0; }
.award__rest-value { font-family: var(--display); font-size: 22px; font-weight: 800; flex-shrink: 0; }

/* Kamper list */
.match-list { border-top: 3px solid var(--ink); }
.match-row {
  display: grid;
  grid-template-columns: 76px 1fr auto;
  gap: 20px;
  align-items: center;
  padding: 18px 8px;
  border-bottom: 1px solid var(--rule);
}
.match-row:hover { background: var(--surface); }
.match-row__date { font-family: var(--display); font-weight: 800; font-size: 22px; line-height: 1; }
.match-row__year { font-size: 13px; color: var(--muted); margin-top: 2px; }
.match-row__mid { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.result-badge {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 900;
  flex-shrink: 0;
}
.result-badge--win { background: var(--red); color: #fff; }
.result-badge--draw { background: var(--rule-strong); color: var(--ink); }
.result-badge--loss { background: var(--ink); color: #fff; }
.match-row__title { font-family: var(--display); font-size: 32px; line-height: 1; font-weight: 800; text-transform: uppercase; }
.match-row__sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.match-row__right { display: flex; align-items: center; gap: 20px; }
.match-row__stat { text-align: right; }
.match-row__stat-label { font-size: 12px; color: var(--muted); }
.match-row__stat-value { font-family: var(--display); font-size: 30px; font-weight: 800; line-height: 1; }
.match-row__stat-note { font-size: 12px; font-style: italic; color: var(--muted); white-space: nowrap; }
.sparkline { display: flex; gap: 3px; align-items: flex-end; height: 40px; }
.sparkline__bar { width: 6px; background: var(--bar-neutral); border-radius: 1px; }
.sparkline__bar.is-disputed { background: var(--red); }
.list-caption { font-size: 14px; color: var(--muted); margin-top: 18px; }

/* Missing-matches callout (Kamper) */
.missing-callout {
  border-left: 6px solid var(--red);
  background: var(--surface);
  border-radius: 0 6px 6px 0;
  padding: 18px 22px;
  margin-bottom: 32px;
}
.missing-callout__title { font-weight: 700; font-size: 16px; margin-bottom: 10px; }
.missing-callout__list { display: flex; flex-direction: column; gap: 6px; }
.missing-callout__row { display: flex; align-items: baseline; gap: 12px; font-size: 14px; color: var(--body); }
.missing-callout__date { font-family: var(--display); font-weight: 800; font-size: 16px; color: var(--ink); width: 52px; flex-shrink: 0; }
.missing-callout__comp { font-size: 13px; color: var(--muted); }

/* Kamp */
.kamp-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; flex-wrap: wrap; padding: 20px 0 32px; }
.kamp-header__meta { font-size: 15px; color: var(--muted); margin-bottom: 12px; }
.kamp-stats { display: flex; gap: 2px; border-radius: 6px; overflow: hidden; }
.kamp-stats > div { background: var(--ink); color: #fff; padding: 12px 18px 10px; min-width: 96px; }
.kamp-stats > div:nth-child(1) { background: var(--bt); }
.kamp-stats > div:nth-child(2) { background: var(--red); }
.kamp-stat__label { font-size: 13px; color: rgba(255,255,255,0.8); }
.kamp-stat__value { font-family: var(--display); font-size: 48px; font-weight: 900; line-height: 1; }

.legend {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 14px 10px;
  border-top: 3px solid var(--ink);
  border-bottom: 1px solid var(--rule);
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.legend__item { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.legend__swatch { width: 14px; height: 14px; border-radius: 2px; background: var(--bt); }
.legend__swatch--ba { border-radius: 50%; background: var(--red); }
.legend__ticks { margin-left: auto; display: flex; gap: 24px; font-family: var(--display); font-weight: 700; font-size: 16px; color: var(--muted); }

.position-group { margin-bottom: 28px; }
.position-group__heading, .squad-block__heading {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--muted);
  padding: 18px 10px 6px;
}

/* Shared rating row (Kamp + Spiller history) */
.rating-row { border-bottom: 1px solid var(--rule); box-shadow: inset 0 0 0 transparent; }
.rating-row.is-disputed { background: var(--tint-red); box-shadow: inset 5px 0 0 var(--red); }
.rating-row:hover { background: var(--surface); }
.rating-row.is-disputed:hover { background: #F8DEE0; }
.rating-row.is-expandable { cursor: pointer; }
.rating-row summary { list-style: none; }
.rating-row summary::-webkit-details-marker { display: none; }
.rating-row__main { display: flex; align-items: center; gap: 16px; padding: 12px 14px; flex-wrap: wrap; }
.rating-row__no { font-family: var(--display); font-weight: 700; font-size: 20px; color: var(--muted-light); width: 26px; text-align: right; flex-shrink: 0; }
.rating-row__player { width: 200px; }
.rating-row__match { width: 240px; }
.rating-row__player:hover .rating-row__name, .rating-row__match:hover .rating-row__name { color: var(--red); }
.rating-row__name { font-size: 16px; font-weight: 600; }
.rating-row__pos, .rating-row__match-sub { font-size: 13px; color: var(--muted); }

.track { flex: 1; min-width: 140px; position: relative; height: 24px; margin: 0 10px; }
.track__baseline { position: absolute; top: 11px; left: 0; right: 0; height: 2px; background: var(--rule); }
.track__segment { position: absolute; top: 9px; height: 6px; border-radius: 3px; background: var(--bar-neutral); }
.track__segment.is-disputed { background: var(--red); }
.track__bt { position: absolute; top: 4px; width: 16px; height: 16px; margin-left: -8px; border-radius: 3px; background: var(--bt); box-shadow: 0 0 0 2px var(--paper); }
.track__ba { position: absolute; top: 4px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px var(--paper); }

.cell-bt, .cell-ba { font-family: var(--display); font-size: 28px; font-weight: 800; width: 30px; text-align: center; line-height: 1; }
.cell-bt { color: var(--bt); }
.cell-ba { color: var(--red); }
.cell-delta { font-family: var(--display); font-size: 20px; font-weight: 700; width: 48px; text-align: right; color: var(--muted-light); }
.cell-delta.is-disputed { color: var(--red); font-weight: 900; }

.commentary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin: 2px 14px 18px; cursor: auto; }
.commentary-card { background: var(--white); padding: 16px 18px; border-radius: 6px; border-top: 5px solid var(--bt); }
.commentary-card--ba { border-top-color: var(--red); }
.commentary-card__label { font-family: var(--display); font-size: 18px; font-weight: 800; text-transform: uppercase; color: var(--bt); margin-bottom: 6px; }
.commentary-card--ba .commentary-card__label { color: var(--red); }
.commentary-card__body { font-size: 15px; line-height: 1.6; color: var(--quote); max-width: 62ch; }

/* Spillere */
.spillere-toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.sort-toggle-label { font-size: 14px; color: var(--muted); }
.squad-block { margin-bottom: 28px; }
.squad-block__heading { padding-left: 0; border-bottom: 3px solid var(--ink); padding-bottom: 8px; color: var(--ink); }
.player-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-top: 14px; }
.player-card { background: var(--surface); border-radius: 6px; padding: 14px 16px 14px; display: block; border: 2px solid transparent; }
.player-card:hover { border-color: var(--ink); background: var(--white); }
.player-card__top { display: flex; align-items: baseline; gap: 10px; }
.player-card__no { font-family: var(--display); font-weight: 700; font-size: 18px; color: var(--muted-light); }
.player-card__name { font-size: 16px; font-weight: 700; line-height: 1.2; }
.player-card__pos { font-size: 13px; color: var(--muted); margin-top: 2px; margin-bottom: 12px; }
.player-card__footer { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; row-gap: 6px; }
.player-card__stat-label { font-size: 12px; color: var(--muted); }
.player-card__stat-value { font-family: var(--display); font-size: 30px; font-weight: 800; line-height: 1; }
.player-card__stat-value.is-bt { color: var(--bt); }
.player-card__stat-value.is-red { color: var(--red); }
.player-card__games { margin-left: auto; text-align: right; }
.player-card__games-value { font-family: var(--display); font-size: 22px; font-weight: 700; line-height: 1; color: var(--muted); }

/* Spiller */
.identity {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 24px 32px;
  padding: 20px 0 40px;
}
.identity__intro { flex: 0 1 auto; min-width: 0; }
.identity__meta { font-size: 15px; color: var(--muted); margin-bottom: 12px; }
.identity__name { overflow-wrap: break-word; }
.identity__stats {
  flex: 1 0 420px;
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2px;
  border-radius: 6px;
  overflow: hidden;
}
.identity__stat { background: var(--ink); color: #fff; padding: 14px 18px 12px; }
.identity__stat:nth-child(1) { background: var(--bt); }
.identity__stat:nth-child(2) { background: var(--red); }
.identity__stat-label { font-size: 13px; color: rgba(255,255,255,0.8); }
.identity__stat-value { font-family: var(--display); font-size: 56px; font-weight: 900; line-height: 1; }

.kfk-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 0 0 12px; border-bottom: 3px solid var(--ink); flex-wrap: wrap; }
.kfk-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sort-toggle { display: flex; gap: 0; background: var(--surface); border-radius: 999px; padding: 3px; }
.sort-toggle a,
.sort-toggle button {
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  background: none;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--body);
  cursor: pointer;
}
.sort-toggle a:hover, .sort-toggle button:hover { color: var(--ink); }
.sort-toggle a.is-active, .sort-toggle button.is-active { background: var(--ink); color: #fff; }

/* Responsive */
@media (max-width: 640px) {
  .brand__name { font-size: 28px; }
  .duel__score { font-size: 84px; }
  .duel__side { padding: 18px 18px 24px; }
  .duel__fact { padding: 14px 16px; flex-direction: column; gap: 2px; }
  .duel__fact:last-child { align-items: flex-end; }
  .duel__fact-value { font-size: 34px; }
  .page-header h1, .kamp-header__title, .identity__name { font-size: 58px; }
  .identity__intro, .identity__stats { flex: 1 1 100%; }
  .awards { margin: 32px 0 28px; }
  .identity__stat-value, .kamp-stat__value { font-size: 40px; }

  .rating-row__player, .rating-row__match { width: 100%; }
  .track { margin: 6px 8px 0 0; }

  .match-row { grid-template-columns: 1fr; gap: 12px; }
  .match-row__right { justify-content: space-between; }

  .nav { flex-wrap: nowrap; }
}

@media (prefers-reduced-motion: no-preference) {
  .duel__side--bt { animation: duel-in-left 520ms cubic-bezier(.2,.8,.2,1) both; }
  .duel__side--ba { animation: duel-in-right 520ms cubic-bezier(.2,.8,.2,1) both; }
  @keyframes duel-in-left { from { transform: translateX(-24px); opacity: 0; } }
  @keyframes duel-in-right { from { transform: translateX(24px); opacity: 0; } }
}
