:root {
  --bg: #f4f5f2;
  --surface: #ffffff;
  --surface-2: #eef0ec;
  --ink: #0d1b2a;
  --ink-2: #47525e;
  --ink-3: #7b8590;
  --line: #dde1dc;
  --accent: #d7263d;
  --accent-ink: #ffffff;
  --win: #1f8a4c;
  --win-bg: #e3f3e8;
  --otw: #5aa575;
  --otl: #d08a2c;
  --loss: #c0392b;
  --loss-bg: #fbe7e4;
  --live: #e0262b;
  --hl: #fff4cc;
  --play: #0d1b2a;
  --play-ink: #ffffff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(13, 27, 42, .06), 0 4px 16px rgba(13, 27, 42, .05);
  --display: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --art: rgba(13, 27, 42, .07);
  --pen: #9a3412;
  --pen-bg: #fde8d8;
  --tint: #e6ebf0;
  color-scheme: light;
}

/* Mörkt tema: följer systemet (auto) om inget annat är valt, eller data-theme="dark". */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b131c;
    --surface: #121d29;
    --surface-2: #192634;
    --ink: #eef2f5;
    --ink-2: #b4bec8;
    --ink-3: #7f8b97;
    --line: #243344;
    --accent: #ff4d5e;
    --win: #4cc27e;
    --win-bg: #143224;
    --otw: #77c495;
    --otl: #e3a24a;
    --loss: #ff6b5b;
    --loss-bg: #3a1a18;
    --hl: #2f2a14;
    --play: #eef2f5;
    --play-ink: #0b131c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    color-scheme: dark;
    --art: rgba(255, 255, 255, .055);
  --pen: #f6b38a;
  --pen-bg: #3d2416;
    --pen: #f6b38a;
    --pen-bg: #3d2416;
    --tint: #0f1c2a;
  }
}
:root[data-theme="dark"] {
  --bg: #0b131c;
  --surface: #121d29;
  --surface-2: #192634;
  --ink: #eef2f5;
  --ink-2: #b4bec8;
  --ink-3: #7f8b97;
  --line: #243344;
  --accent: #ff4d5e;
  --win: #4cc27e;
  --win-bg: #143224;
  --otw: #77c495;
  --otl: #e3a24a;
  --loss: #ff6b5b;
  --loss-bg: #3a1a18;
  --hl: #2f2a14;
  --play: #eef2f5;
  --play-ink: #0b131c;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  color-scheme: dark;
  --art: rgba(255, 255, 255, .055);
  --tint: #0f1c2a;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: linear-gradient(180deg, var(--tint) 0, var(--bg) 460px) no-repeat, var(--bg);
  position: relative;
  isolation: isolate;
  color: var(--ink);
  font: 15px/1.45 var(--body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; }
img { display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: #0d1b2a;
  color: #fff;
  border-bottom: 3px solid var(--accent);
}
.topbar-inner {
  max-width: 1080px; margin: 0 auto;
  padding: 10px 16px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.brand {
  font: 700 22px/1 var(--display);
  letter-spacing: .02em; text-transform: uppercase; text-decoration: none;
}
.brand span { color: var(--accent); }
.league-switch { display: flex; background: rgba(255,255,255,.08); border-radius: 999px; padding: 3px; }
.league-switch button {
  border: 0; background: transparent; color: #cfd6dd;
  font: 600 13px/1 var(--body); padding: 7px 14px; border-radius: 999px; cursor: pointer;
}
.league-switch button[aria-selected="true"] { background: #fff; color: #0d1b2a; }
.team-select-wrap { margin-left: auto; flex: 1 1 200px; max-width: 280px; }
#team-select {
  width: 100%;
  appearance: none;
  background: rgba(255,255,255,.08) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23fff' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 12px center;
  color: #fff; border: 1px solid rgba(255,255,255,.18); border-radius: 10px;
  font: 500 14px var(--body); padding: 9px 34px 9px 12px;
}
#team-select option { color: #0d1b2a; }

/* ---------- Layout ---------- */
main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 20px 16px 40px; }
.loading, .error { padding: 60px 0; text-align: center; color: var(--ink-2); }
.error button { margin-top: 12px; }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
h2.section {
  font: 700 20px/1.1 var(--display); text-transform: uppercase; letter-spacing: .03em;
  margin: 28px 0 10px;
}

/* ---------- Team picker ---------- */
.picker-intro { margin: 8px 0 18px; }
.picker-intro h1 { font: 700 34px/1 var(--display); text-transform: uppercase; margin: 0 0 6px; }
.picker-intro p { margin: 0; color: var(--ink-2); }
.team-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.team-tile {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 18px 10px 14px; text-decoration: none; text-align: center;
  transition: transform .12s ease, border-color .12s ease;
}
.team-tile:hover { transform: translateY(-2px); border-color: var(--ink-3); }
.team-tile img { width: 56px; height: 56px; object-fit: contain; }
.team-tile .nm { font-weight: 600; font-size: 14px; }
.team-tile .rk { font-size: 12px; color: var(--ink-3); }

/* ---------- Omgång ---------- */
.round { overflow: hidden; }
.round-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; }
.round-head > div { text-align: center; }
.round-head h2 { margin: 0; font: 700 20px/1 var(--display); text-transform: uppercase; letter-spacing: .03em; }
.round-head span { font-size: 12px; color: var(--ink-3); }
.round-head .btn { font-size: 18px; padding: 4px 12px; }
.round-head .btn:disabled { opacity: .35; cursor: default; }
.rgame {
  display: grid; align-items: center; gap: 10px;
  grid-template-columns: 90px 1fr 84px 1fr 150px;
  grid-template-areas: "date home mid away links";
  padding: 9px 14px; border-top: 1px solid var(--line);
}
.rdate { grid-area: date; font-size: 12px; color: var(--ink-2); }
.rgame .rt.h { grid-area: home; justify-content: flex-end; text-align: right; }
.rgame .rt.a { grid-area: away; }
.rgame .rt.h img, .rgame .rt.h .nologo { order: 2; }
.rt { display: flex; align-items: center; gap: 8px; text-decoration: none; min-width: 0; font-weight: 500; }
.rt span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rt:hover span { text-decoration: underline; }
.rt.won { font-weight: 700; }
.rt img { width: 26px; height: 26px; object-fit: contain; flex: none; }
.rmid { grid-area: mid; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.rs { font: 700 20px/1 var(--display); display: inline-flex; align-items: center; gap: 4px; }
.rs.live { color: var(--live); }
.rs small { font: 600 10px var(--body); color: var(--ink-3); }
.rtime { font: 700 16px/1 var(--display); color: var(--ink-2); }
.rlinks { grid-area: links; display: flex; justify-content: flex-end; gap: 6px; }
@media (max-width: 640px) {
  .rgame {
    grid-template-columns: 1fr auto 1fr;
    grid-template-areas: "date date date" "home mid away" "links links links";
    row-gap: 6px;
  }
  .rdate { text-align: center; }
  .rt { flex-direction: column; gap: 4px; text-align: center; font-size: 13px; }
  .rgame .rt.h { justify-content: center; text-align: center; }
  .rgame .rt.h img, .rgame .rt.h .nologo { order: 0; }
  .rt span { white-space: normal; }
  .rlinks { justify-content: center; }
}

/* ---------- Hero ---------- */
.hero { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .hero { grid-template-columns: 1.15fr 1fr; } }
.team-head { padding: 20px; display: flex; gap: 18px; align-items: center; }
.team-head img { width: 84px; height: 84px; object-fit: contain; flex: none; }
.team-head h1 { font: 700 36px/1 var(--display); text-transform: uppercase; margin: 0 0 6px; }
.team-meta { color: var(--ink-2); font-size: 14px; }
.team-meta strong { color: var(--ink); }
.kpis { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 13px; color: var(--ink-2); }
.kpis b { font: 700 18px/1 var(--display); color: var(--ink); margin-right: 3px; }
.form { display: flex; gap: 4px; margin-top: 12px; align-items: center; }
.form .lbl { font-size: 12px; color: var(--ink-3); margin-right: 4px; }
.pill {
  display: inline-grid; place-items: center;
  min-width: 24px; height: 24px; padding: 0 5px; border-radius: 6px;
  font: 700 12px/1 var(--body); color: #fff;
}
.pill.W { background: var(--win); }
.pill.OTW { background: var(--otw); }
.pill.OTL { background: var(--otl); }
.pill.L { background: var(--loss); }

.next { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.next .kicker { font: 700 13px/1 var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); display: flex; align-items: center; gap: 8px; }
.matchup { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.matchup .side { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-weight: 600; font-size: 14px; }
.matchup .side img { width: 48px; height: 48px; object-fit: contain; }
.matchup .mid { text-align: center; }
.matchup .time { font: 700 30px/1 var(--display); }
.matchup .date { font-size: 13px; color: var(--ink-2); margin-top: 4px; }
.matchup .score { font: 700 40px/1 var(--display); }
.next .venue { font-size: 13px; color: var(--ink-3); text-align: center; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; padding: 8px 14px;
  font: 600 13px/1 var(--body); text-decoration: none; white-space: nowrap;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer;
}
.btn:hover { border-color: var(--ink-3); }
.btn.play { background: var(--play); color: var(--play-ink); border-color: var(--play); }
.btn.play.live { background: var(--live); border-color: var(--live); color: #fff; }
.btn.sm { padding: 6px 10px; font-size: 12px; }
.btn svg { width: 12px; height: 12px; }

.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live); animation: pulse 1.4s infinite; display: inline-block; }
@keyframes pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } .team-tile { transition: none; } }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; margin: 26px 0 14px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs button {
  border: 0; background: none; color: var(--ink-2); cursor: pointer;
  font: 700 16px/1 var(--display); text-transform: uppercase; letter-spacing: .04em;
  padding: 12px 12px 10px; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }

/* ---------- Game list ---------- */
.games { overflow: hidden; }
.games-head { display: flex; align-items: baseline; justify-content: space-between; padding: 14px 16px 8px; }
.games-head h3 { margin: 0; font: 700 17px/1 var(--display); text-transform: uppercase; letter-spacing: .03em; }
.games-head span { font-size: 12px; color: var(--ink-3); }
.game {
  display: grid; align-items: center; gap: 10px;
  grid-template-columns: 74px 1fr auto;
  padding: 10px 16px; border-top: 1px solid var(--line);
}
.game .when { font-size: 12px; color: var(--ink-2); line-height: 1.3; }
.game .when b { display: block; color: var(--ink); font-size: 13px; }
.game .opp { display: flex; align-items: center; gap: 10px; min-width: 0; }
.game .opp img { width: 28px; height: 28px; object-fit: contain; flex: none; }
.game .opp .t { min-width: 0; }
.game .opp .n { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game .opp .ha { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
.game .right { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.res {
  font: 700 18px/1 var(--display); padding: 5px 8px; border-radius: 8px; min-width: 56px; text-align: center;
}
.res.W { background: var(--win-bg); color: var(--win); }
.res.L { background: var(--loss-bg); color: var(--loss); }
.res small { font: 600 10px var(--body); margin-left: 3px; }
.game .links { display: flex; gap: 6px; }
@media (max-width: 560px) {
  .game {
    grid-template-columns: 1fr auto;
    grid-template-areas: "when right" "opp right";
    row-gap: 4px; padding: 10px 14px;
  }
  .game .when { grid-area: when; display: flex; gap: 6px; font-size: 12px; }
  .game .when b { display: inline; font-size: 12px; font-weight: 600; }
  .game .opp { grid-area: opp; }
  .game .right { grid-area: right; flex-direction: column; align-items: flex-end; gap: 6px; }
  .team-head { padding: 16px; gap: 14px; }
  .team-head img { width: 64px; height: 64px; }
  .team-head h1 { font-size: 30px; }
}
.two-col { display: grid; gap: 14px; }
@media (min-width: 900px) { .two-col { grid-template-columns: 1fr 1fr; align-items: start; } }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 9px 10px; text-align: right; white-space: nowrap; }
th:first-child, td:first-child { padding-left: 16px; }
th:last-child, td:last-child { padding-right: 16px; }
th {
  font: 600 11px/1 var(--body); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3);
  border-bottom: 1px solid var(--line); background: var(--surface);
}
th.sortable { cursor: pointer; user-select: none; }
th.sorted { color: var(--ink); }
th.sorted::after { content: ' ▼'; font-size: 8px; }
th.sorted.asc::after { content: ' ▲'; }
td { border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: 0; }
td.l, th.l { text-align: left; }
td.team-cell { display: flex; align-items: center; gap: 8px; }
td.team-cell img { width: 22px; height: 22px; object-fit: contain; }
td.team-cell a { text-decoration: none; font-weight: 500; }
td.team-cell a:hover { text-decoration: underline; }
td.strong { font-weight: 700; }
tr.me td { background: var(--hl); }
tr.cut td { border-bottom: 2px solid var(--ink-3); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; padding: 10px 16px 14px; font-size: 12px; color: var(--ink-3); border-top: 1px solid var(--line); }
.num { color: var(--ink-3); font-size: 12px; margin-right: 4px; }
.tag { font-size: 10px; font-weight: 600; color: var(--ink-3); border: 1px solid var(--line); border-radius: 4px; padding: 1px 4px; margin-left: 6px; }
.empty { padding: 24px 16px; color: var(--ink-3); text-align: center; }

/* ---------- Leaders ---------- */
.leaders { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); grid-auto-flow: dense; }
.leader { padding: 16px; }
.leader h4 { margin: 0 0 10px; font: 700 15px/1 var(--display); text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); }
.leader ol { list-style: none; margin: 0; padding: 0; }
.leader li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 14px; }
.leader li:first-child { border-top: 0; }
.leader li:first-child .v { font-size: 26px; }
.leader .v { font: 700 18px/1 var(--display); }
.leader .sub { color: var(--ink-3); font-size: 12px; }

.footer { text-align: center; font-size: 12px; color: var(--ink-3); padding: 18px 16px 28px; }
.footer p { margin: 0; }

/* ---------- Tävlingar, slutspel, version ---------- */
.comp-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 28px 0 10px; }
.comp-head h2.section { margin: 0; }
.seg { display: flex; background: var(--surface-2); border-radius: 999px; padding: 3px; border: 1px solid var(--line); }
.seg button {
  border: 0; background: transparent; color: var(--ink-2); cursor: pointer;
  font: 600 13px/1 var(--body); padding: 7px 12px; border-radius: 999px; white-space: nowrap;
}
.seg button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.stage + .stage { margin-top: 14px; }
.pair + .pair { border-top: 2px solid var(--line); }
.series {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 14px 4px; font-size: 13px; color: var(--ink-2);
}
.series b { font: 700 18px/1 var(--display); color: var(--ink); }
.series small { color: var(--ink-3); font-size: 11px; margin-left: 4px; }
.ctag { font-size: 10px; font-weight: 700; letter-spacing: .04em; padding: 1px 5px; border-radius: 4px; text-transform: uppercase; }
.ctag.cup { background: #e8eefb; color: #2a4fa0; }
.ctag.slutspel { background: #fdeccc; color: #8a5a00; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ctag.cup { background: #1d2c4a; color: #9db8f0; }
  :root:not([data-theme="light"]) .ctag.slutspel { background: #3a2c10; color: #f0c56b; }
}
:root[data-theme="dark"] .ctag.cup { background: #1d2c4a; color: #9db8f0; }
:root[data-theme="dark"] .ctag.slutspel { background: #3a2c10; color: #f0c56b; }
.nologo { display: inline-block; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); flex: none; }
.footer .version { margin-top: 4px; font-variant-numeric: tabular-nums; opacity: .8; }

/* ---------- Mål under matchen ---------- */
.rgame.has-goals { grid-template-areas: "date home mid away links" ". goals goals goals ."; }
.rgoals { grid-area: goals; display: flex; flex-direction: column; gap: 2px; padding: 2px 0 4px; }
.gl { display: grid; grid-template-columns: 1fr 120px 1fr; gap: 10px; align-items: baseline; font-size: 12.5px; line-height: 1.5; color: var(--ink-2); }
.gl .gh { text-align: right; }
.gl .gm { display: flex; justify-content: center; align-items: baseline; gap: 6px; white-space: nowrap; }
.gl .gm b { font: 700 13px/1.1 var(--display); color: var(--ink); }
.gl .gm small, .gl small { font-size: 10.5px; color: var(--ink-3); }
.gl.pen { color: var(--ink-3); }
.gl.pen .gm b.pmin { font: 700 10.5px/1.3 inherit; color: var(--pen); background: var(--pen-bg); border-radius: 4px; padding: 0 5px; letter-spacing: .02em; }
.gl.pp .gm b { color: var(--pen); background: var(--pen-bg); border-radius: 4px; padding: 1px 5px; }
.rmid .clk { font-size: 10.5px; font-weight: 600; color: var(--live); white-space: nowrap; }
.next .rgoals { border-top: 1px solid var(--line); padding-top: 8px; }
.next .gl { grid-template-columns: 1fr 104px 1fr; }
@media (max-width: 640px) {
  .rgame.has-goals { grid-template-areas: "date date date" "home mid away" "goals goals goals" "links links links"; }
  .gl, .next .gl { grid-template-columns: 1fr 58px 1fr; gap: 6px; font-size: 12px; }
  .gl .gm { flex-direction: column; align-items: center; gap: 0; line-height: 1.15; }
}

/* ---------- Utfällbara mål i lagets matchlista ---------- */
.gtoggle .chev { display: inline-block; transition: transform .15s ease; font-size: 10px; }
.gtoggle[aria-expanded="true"] { background: var(--surface-2); }
.gtoggle[aria-expanded="true"] .chev { transform: rotate(180deg); }
.gdetail { grid-column: 1 / -1; padding: 4px 0 2px; min-width: 0; }
.gl > span { min-width: 0; overflow-wrap: anywhere; }
.gdetail .rgoals { border-top: 1px dashed var(--line); padding-top: 6px; }
.gc-cols { display: grid; grid-template-columns: 1fr 120px 1fr; gap: 10px; margin: 2px 0 4px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.gc-cols span:first-child { text-align: right; }
.gdetail .opp-goal { color: var(--ink-3); }
.empty.sm { padding: 8px 0 4px; font-size: 12px; }
.gc-link { display: inline-block; margin-top: 6px; font-size: 11.5px; color: var(--ink-3); }
.exp-all { display: flex; gap: 12px; }
.linkbtn { border: 0; background: none; padding: 0; cursor: pointer; font: 600 12px var(--body); color: var(--ink-2); text-decoration: underline; text-underline-offset: 2px; }
.linkbtn:hover, .linkbtn[aria-pressed="true"] { color: var(--ink); }
@media (max-width: 560px) {
  .game.expanded { grid-template-areas: "when right" "opp right" "detail detail"; }
  .gdetail { grid-area: detail; }
  .gc-cols { grid-template-columns: 1fr 58px 1fr; gap: 6px; }
}
@media (prefers-reduced-motion: reduce) { .gtoggle .chev { transition: none; } }

.comp-head .exp-all { margin-left: auto; }
@media (max-width: 640px) { .comp-head .exp-all { order: 3; width: 100%; justify-content: flex-end; } }

.leader li.mine { background: var(--hl); margin: 0 -8px; padding-left: 8px; padding-right: 8px; border-radius: 6px; }

/* ---------- Spelarkort (utfällning i Spelare-fliken) ---------- */
tr.prow { cursor: pointer; }
tr.prow:hover td { background: var(--surface-2); }
tr.prow:focus-visible { outline: 2px solid var(--accent, currentColor); outline-offset: -2px; }
tr.prow .chev { font-size: 10px; color: var(--ink-3); margin-left: 6px; display: inline-block; transition: transform .15s ease; }
tr.prow[aria-expanded="true"] td { background: var(--surface-2); border-bottom-color: transparent; }
tr.prow[aria-expanded="true"] .chev { transform: rotate(180deg); }
tr.pdetail td { background: var(--surface-2); padding: 4px 10px 12px; text-align: left; white-space: normal; }
.pcard { display: flex; gap: 14px; align-items: flex-start; position: sticky; left: 10px; max-width: calc(100vw - 52px); }
.pphoto { width: 84px; height: 104px; flex: none; border-radius: 8px; object-fit: cover; object-position: top; background: var(--line); }
.pav { width: 26px; height: 26px; border-radius: 50%; overflow: hidden; position: relative; vertical-align: middle; margin: -4px 8px -4px 0; background: var(--line); display: inline-block; }
.pav img { position: absolute; width: 210%; left: -55%; top: -3%; height: auto; max-width: none; }
.pav.none { display: inline-grid; place-items: center; font: 600 11px/1 'Barlow Condensed', sans-serif; color: var(--ink-3); }
.pphoto.none { display: grid; place-items: center; font: 600 24px/1 'Barlow Condensed', sans-serif; color: var(--ink-3); }
.pinfo { min-width: 0; flex: 1; }
.pname { font: 600 18px/1.2 'Barlow Condensed', sans-serif; }
.pnum { color: var(--ink-3); margin-right: 6px; }
.psum { font-size: 13px; color: var(--ink-2, var(--ink-3)); margin: 2px 0 6px; }
.pfacts { display: grid; grid-template-columns: max-content 1fr; gap: 2px 10px; margin: 0; font-size: 13px; }
.pfacts dt { color: var(--ink-3); }
.pfacts dd { margin: 0; white-space: normal; }
.pnote { font-size: 12px; color: var(--ink-3); margin: 6px 0 0; }
.plink { display: inline-block; margin-top: 6px; font-size: 12px; }
@media (max-width: 560px) {
  .pphoto { width: 64px; height: 80px; }
  .pfacts { grid-template-columns: 1fr; }
  .pfacts dt { margin-top: 4px; }
}
@media (prefers-reduced-motion: reduce) { tr.prow .chev { transition: none; } }
tr.prow .num { display: inline-block; min-width: 2.4ch; text-align: right; margin-right: 8px; }

/* ---------- Ligan: utfällbara topplistor ---------- */
.leader h4 .lhead { all: unset; cursor: pointer; display: flex; align-items: center; gap: 8px; width: 100%; font: inherit; text-transform: inherit; letter-spacing: inherit; color: inherit; }
.leader h4 .lhead:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.leader .lcount { margin-left: auto; font: 500 12px/1 var(--body, 'Inter', sans-serif); text-transform: none; letter-spacing: 0; color: var(--ink-3); }
.leader .chev { font-size: 10px; color: var(--ink-3); display: inline-block; transition: transform .15s ease; }
.leader .lhead:hover .lcount, .leader .lhead:hover .chev { color: var(--ink); }
.leader.open { grid-column: 1 / -1; }
.leader.open .chev { transform: rotate(180deg); }
.leader.open ol { columns: 2 300px; column-gap: 28px; }
.leader.open li { break-inside: avoid; }
.leader.open li:first-child .v { font-size: 18px; }
.leader .rk { width: 4ch; flex: none; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.leader li .nm { flex: 1; min-width: 0; }
.leader .lnote { margin: -4px 0 8px; font-size: 12px; color: var(--ink-3); }
.leader .lclose { margin-top: 10px; }
@media (prefers-reduced-motion: reduce) { .leader .chev { transition: none; } }

/* ---------- Bakgrundsmotiv: nedtonat bollhålsmönster från övre högra hörnet ---------- */
/* Ritas som mask så att färgen följer temat (--art). Ligger fast bakom innehållet. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: var(--art);
  -webkit-mask: url(bg-dots.svg) right top / cover no-repeat;
  mask: url(bg-dots.svg) right top / cover no-repeat;
}
@media (max-width: 640px) {
  body::before { -webkit-mask-size: 820px auto; mask-size: 820px auto; }
}

/* ---------- Temaväljare ---------- */
.theme-btn {
  flex: none; width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; color: #fff; background: rgba(255,255,255,.08);
}
.theme-btn:hover { background: rgba(255,255,255,.16); }
.theme-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.theme-btn svg { width: 18px; height: 18px; }
@media (max-width: 560px) {
  .team-select-wrap { margin-left: 0; max-width: none; }
}
