/* Layout: vänsterställd kolumn (max 1120 px), årshjulet som bärande bild i hero, tunna "banlinjer" som avdelare. */
:root {
  --bg: #F4F6F1;
  --bg-2: #E9EDE3;
  --ink: #0F2240;
  --ink-2: #4B5A72;
  --line: #C7D0BF;
  --lime: #C8F000;
  --lime-ink: #0F2240;
  --clay: #C9502A;
  --clay-ink: #FFFFFF;
  --court: #1F6FB2;
  --court-ink: #FFFFFF;
  --gold: #D9A400;
  --gold-ink: #0F2240;
  --rod: #D0312D;
  --orange: #F08A24;
  --gron: #2F9E44;
  --gul: #C8F000;
  --alla-grad: linear-gradient(90deg, var(--rod) 0 25%, var(--orange) 25% 50%, var(--gron) 50% 75%, var(--gul) 75%);
  --font-display: "Barlow Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Barlow", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --logo-plate: transparent;
  --logo-pad: 0;
  --wh-sel: rgba(15, 34, 64, 0.16);
  --radius: 6px;
  --gutter: clamp(16px, 4vw, 40px);
  --measure: 64ch;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B1A33;
    --bg-2: #13264A;
    --ink: #EEF2F7;
    --ink-2: #A9B6C9;
    --line: #2A3C5C;
    --lime: #D4F53C;
    --lime-ink: #0B1A33;
    --clay: #E0754F;
    --clay-ink: #0B1A33;
    --court: #5AA0E0;
    --court-ink: #0B1A33;
    --gold: #F0C040;
    --gold-ink: #0B1A33;
    --rod: #EF5A56;
    --orange: #F7A24A;
    --gron: #4FC46A;
    --gul: #D4F53C;
    --logo-plate: #F4F6F1;
    --logo-pad: 4px 8px;
    --wh-sel: rgba(238, 242, 247, 0.2);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0B1A33;
  --bg-2: #13264A;
  --ink: #EEF2F7;
  --ink-2: #A9B6C9;
  --line: #2A3C5C;
  --lime: #D4F53C;
  --lime-ink: #0B1A33;
  --clay: #E0754F;
  --clay-ink: #0B1A33;
  --court: #5AA0E0;
  --court-ink: #0B1A33;
  --gold: #F0C040;
  --gold-ink: #0B1A33;
  --rod: #EF5A56;
  --orange: #F7A24A;
  --gron: #4FC46A;
  --gul: #D4F53C;
  --logo-plate: #F4F6F1;
  --logo-pad: 4px 8px;
  --wh-sel: rgba(238, 242, 247, 0.2);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.5;
  padding-inline: var(--gutter);
  padding-block: 0 48px;
}
img, svg { max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.02; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(56px, 9vw, 112px); font-weight: 800; letter-spacing: -0.01em; text-transform: uppercase; }
h2 { font-size: clamp(36px, 6vw, 60px); font-weight: 700; text-transform: uppercase; }
h3 { font-size: 26px; font-weight: 700; }
p { margin: 0; }
.mono { font-family: var(--font-mono); font-size: 0.92em; font-variant-numeric: tabular-nums; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.skip { position: absolute; left: -999px; top: 8px; background: var(--lime); color: var(--lime-ink); padding: 8px 12px; }
.skip:focus { left: var(--gutter); z-index: 10; }
:focus-visible { outline: 3px solid var(--court); outline-offset: 2px; }
.is-hidden { display: none !important; }

/* Toppbar */
.topbar {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-block: 12px;
  margin-inline: calc(-1 * var(--gutter));
  padding-inline: var(--gutter);
  background: var(--bg);
  border-bottom: 2px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-logo { height: 48px; width: auto; display: block; border-radius: 6px; background: var(--logo-plate); padding: var(--logo-pad); }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 26px; text-transform: uppercase; letter-spacing: 0.02em; }
body.bild .brand-logo { height: 84px; }
.brand-sub { font-family: var(--font-mono); font-size: 12px; color: var(--ink-2); letter-spacing: 0.06em; text-transform: uppercase; }
.topnav { display: flex; gap: 4px 18px; flex-wrap: wrap; }
.topnav a { text-decoration: none; font-weight: 600; font-size: 15px; padding-block: 4px; border-bottom: 2px solid transparent; }
.topnav a:hover { border-bottom-color: var(--lime); }

/* Knappar och chips */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-decoration: none;
  border: 2px solid var(--ink);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.btn-primary { background: var(--lime); border-color: var(--lime); color: var(--lime-ink); }
.btn-primary:hover { filter: brightness(0.95); }
.btn-ghost:hover { background: var(--bg-2); }
.btn-small { padding: 7px 12px; font-size: 16px; }
.chip {
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.chip:hover { border-color: var(--ink-2); }
.chip.is-active { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* Hero med årshjulet */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 640px);
  gap: 32px 40px;
  align-items: center;
  padding-block: clamp(32px, 5vw, 64px) clamp(32px, 5vw, 56px);
  border-bottom: 2px solid var(--line);
}
.hero-text { display: grid; gap: 20px; min-width: 0; }
.lede { font-size: clamp(18px, 2vw, 21px); max-width: var(--measure); color: var(--ink-2); }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.legend { display: flex; gap: 8px 18px; flex-wrap: wrap; font-size: 14px; color: var(--ink-2); }
.legend-item::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend-item.lane-rod::before { background: var(--rod); }
.legend-item.lane-orange::before { background: var(--orange); }
.legend-item.lane-gron::before { background: var(--gron); }
.legend-item.lane-gul::before { background: var(--gul); }
.legend-item.lane-alla::before { background: var(--alla-grad); width: 18px; }
.legend-item.is-grus::before { background: var(--clay); opacity: 0.4; }
.legend-item.is-prelim::before { background: repeating-linear-gradient(90deg, var(--ink-2) 0 3px, transparent 3px 6px); height: 4px; vertical-align: 3px; border-radius: 2px; }

.wheel-wrap { width: 100%; max-width: 640px; margin-inline: auto; min-width: 0; container-type: inline-size; }
.wheel-stage { position: relative; touch-action: pan-y; }
.wheel { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--font-body); }
.wh-ring { fill: none; stroke: var(--bg-2); stroke-width: 28; }
.wh-grus { fill: none; stroke: var(--clay); stroke-width: 28; opacity: 0.35; }
.wh-sel { fill: none; stroke: var(--wh-sel); stroke-width: 28; display: none; }
.wh-sector { fill: transparent; stroke: none; cursor: pointer; outline: none; }
.wh-sector:focus-visible { stroke: var(--court); stroke-width: 3; }
.wh-tick { stroke: var(--line); stroke-width: 2; pointer-events: none; }
.wh-month { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; fill: var(--ink-2); pointer-events: none; }
.wh-month.is-now { fill: var(--ink); font-weight: 500; }
.wh-month.is-hover { fill: var(--ink); }
.wheel-wrap.is-compact .wh-month { font-size: 19px; }
.wheel-wrap.is-compact .wh-sel { display: block; }
.wheel-wrap.is-compact .wh-month.is-sel { fill: var(--ink); font-weight: 600; }
.wheel-wrap.is-compact .wheel.has-sel .wh-ev { opacity: 0.32; }
.wheel-wrap.is-compact .wheel.has-sel .wh-ev.is-sel { opacity: 1; }
.wheel-wrap.is-compact .wheel.has-sel .wh-ev.is-sel.is-cancelled { opacity: 0.5; }
.wheel-wrap.is-compact .wh-dot.is-sel { transform: scale(1.3); transform-box: fill-box; transform-origin: center; }
.wheel-wrap.is-compact .wheel a { pointer-events: none; }
body.bild .wh-sel { display: none; }
body.bild .wheel.has-sel .wh-ev { opacity: 1; }
.wh-today { stroke: var(--ink); stroke-width: 4; stroke-linecap: round; }
.wh-dot { stroke: var(--bg); stroke-width: 3; }
.wh-arc { fill: none; stroke-width: 18; stroke-linecap: round; }
.wh-arc-thin { fill: none; stroke-width: 7; stroke-linecap: round; stroke-dasharray: 9 9; }
.wh-ev.is-prelim { stroke-dasharray: 10 9; stroke-linecap: butt; }
.wh-ev.is-cancelled { opacity: 0.35; }
.wh-dot.lane-rod { fill: var(--rod); }
.wh-dot.lane-orange { fill: var(--orange); }
.wh-dot.lane-gron { fill: var(--gron); }
.wh-dot.lane-gul { fill: var(--gul); }
.wh-dot.lane-alla { fill: url(#p-alla); }
.wh-arc.lane-rod, .wh-arc-thin.lane-rod { stroke: var(--rod); }
.wh-arc.lane-orange, .wh-arc-thin.lane-orange { stroke: var(--orange); }
.wh-arc.lane-gron, .wh-arc-thin.lane-gron { stroke: var(--gron); }
.wh-arc.lane-gul, .wh-arc-thin.lane-gul { stroke: var(--gul); }
.wh-arc.lane-alla, .wh-arc-thin.lane-alla { stroke: url(#p-alla); }
.wh-leader { fill: none; stroke: var(--line); stroke-width: 1.5; }
.wh-label { font-size: 18px; font-weight: 600; fill: var(--ink); }
.wh-label .wh-when { font-family: var(--font-mono); font-size: 14px; font-weight: 400; fill: var(--ink-2); }
.wh-label.is-cancelled { text-decoration: line-through; fill: var(--ink-2); }
.wh-label.is-today { fill: var(--ink-2); }
.wh-todaylabel .wh-leader { stroke: var(--ink); }
.wheel a { cursor: pointer; }
.wheel a:hover .wh-label { text-decoration: underline; }
.wheel a:hover .wh-dot, .wheel a:hover .wh-arc, .wheel a:hover .wh-arc-thin { filter: brightness(0.9); }
.wheel-wrap.is-compact .wh-label, .wheel-wrap.is-compact .wh-leader { display: none; }
.wheel-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 36%;
  height: 36%;
  width: 36cqw;
  height: 36cqw;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  gap: 2px;
  padding: 5%;
  text-decoration: none;
  min-width: 0;
  overflow: hidden;
}
.wheel-center:hover .next-name { text-decoration: underline; }
.wheel-wrap.is-compact .wheel-center { width: 56cqw; height: 56cqw; }
.next-label { font-family: var(--font-mono); font-size: clamp(9px, 1.6cqw, 11px); letter-spacing: 0.08em; text-transform: uppercase; color: var(--lime); }
.next-name { font-family: var(--font-display); font-size: clamp(16px, 3.4cqw, 26px); font-weight: 700; line-height: 1.02; text-wrap: balance; }
.next-when { font-family: var(--font-mono); font-size: clamp(10px, 1.9cqw, 13px); font-variant-numeric: tabular-nums; }
.next-meta { font-size: clamp(10px, 1.9cqw, 13px); opacity: 0.85; }
.next-empty { font-size: 13px; opacity: 0.85; }
.wheel-wrap.is-compact .next-name { font-size: clamp(16px, 5cqw, 24px); }
.wheel-wrap.is-compact .next-when, .wheel-wrap.is-compact .next-meta { font-size: clamp(10px, 2.8cqw, 13px); }
body.bild .next-label { font-size: 12px; }
body.bild .next-name { font-size: 28px; }
body.bild .next-when, body.bild .next-meta { font-size: 14px; }

/* Månadspanel under hjulet (bara smala skärmar) */
.month-panel { display: none; margin-top: 10px; }
.wheel-wrap.is-compact .month-panel { display: block; }
.mp-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mp-nav { flex: none; width: 42px; height: 42px; border: 2px solid var(--line); border-radius: 50%; background: transparent; color: var(--ink); font-size: 26px; line-height: 1; padding: 0 0 3px; cursor: pointer; }
.mp-nav:hover { border-color: var(--ink-2); }
.mp-title { font-family: var(--font-display); font-size: 24px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; margin: 0; text-align: center; min-width: 0; }
.mp-count { display: block; font-family: var(--font-mono); font-size: 12px; font-weight: 400; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.mp-hint { font-size: 14px; color: var(--ink-2); text-align: center; margin: 8px 0 0; }
.mp-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.mp-row { display: flex; align-items: center; gap: 10px; padding: 11px 12px 11px 14px; border: 2px solid var(--line); border-left-width: 6px; border-radius: var(--radius); text-decoration: none; min-width: 0; }
.mp-row { position: relative; }
.mp-row.lane-rod { border-left-color: var(--rod); }
.mp-row.lane-orange { border-left-color: var(--orange); }
.mp-row.lane-gron { border-left-color: var(--gron); }
.mp-row.lane-gul { border-left-color: var(--gul); }
.mp-row.lane-alla { border-left-color: transparent; }
.mp-row.lane-alla::before { content: ""; position: absolute; left: -6px; top: -2px; bottom: -2px; width: 6px; border-radius: 6px 0 0 6px; background: linear-gradient(180deg, var(--rod) 0 25%, var(--orange) 25% 50%, var(--gron) 50% 75%, var(--gul) 75%); }
.mp-row.is-prelim { border-style: dashed; border-left-style: solid; }
.mp-text { display: grid; gap: 2px; flex: 1; min-width: 0; }
.mp-name { font-weight: 600; }
.mp-row.is-cancelled .mp-name { text-decoration: line-through; color: var(--ink-2); }
.mp-when { font-family: var(--font-mono); font-size: 13px; color: var(--ink-2); }
.mp-chev { font-size: 24px; line-height: 1; color: var(--ink-2); flex: none; }
.mp-empty { color: var(--ink-2); font-size: 15px; padding: 8px 0; }
.month-item.is-flash .month-name { color: var(--ink); border-bottom-color: var(--lime); border-bottom-width: 3px; }

/* Sektioner */
.section { padding-block: clamp(40px, 6vw, 72px); border-bottom: 2px solid var(--line); }
.section-head { display: grid; gap: 10px; margin-bottom: 28px; }
.section-lede { max-width: var(--measure); color: var(--ink-2); font-size: 18px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }

/* Månadsagenda */
.monthlist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 18px 24px; }
.month-item { display: grid; gap: 4px; align-content: start; min-width: 0; }
.month-item.is-empty { opacity: 0.6; }
.month-name { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.month-ev { display: flex; gap: 10px; align-items: baseline; justify-content: space-between; text-decoration: none; padding: 6px 0; min-width: 0; }
.month-ev > span:first-child { font-weight: 600; }
.month-ev::before { content: ""; width: 10px; height: 10px; border-radius: 3px; flex: none; transform: translateY(-1px); margin-right: -4px; }
.month-ev.lane-rod::before { background: var(--rod); }
.month-ev.lane-orange::before { background: var(--orange); }
.month-ev.lane-gron::before { background: var(--gron); }
.month-ev.lane-gul::before { background: var(--gul); }
.month-ev.lane-alla::before { background: var(--alla-grad); }
.month-ev .mono { color: var(--ink-2); font-size: 13px; white-space: nowrap; }
.month-ev.is-cancelled > span:first-child { text-decoration: line-through; color: var(--ink-2); }
.month-ev:hover > span:first-child { text-decoration: underline; }
.month-empty { color: var(--ink-2); font-size: 14px; }

/* Kort */
.season { margin-bottom: 36px; }
.season-title {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.season-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 16px; }
.card {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 20px 20px 22px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  min-width: 0;
  scroll-margin-top: 90px;
}
.card.is-past { opacity: 0.72; }
.card.is-cancelled { opacity: 0.6; border-style: dashed; }
.card.is-cancelled h3 { text-decoration: line-through; text-decoration-thickness: 2px; }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 3px;
}
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag-type { border: 1.5px solid var(--line); color: var(--ink-2); }
.card.lane-rod .tag-lane { background: var(--rod); color: #FFFFFF; }
.card.lane-orange .tag-lane { background: var(--orange); color: #0F2240; }
.card.lane-gron .tag-lane { background: var(--gron); color: #FFFFFF; }
.card.lane-gul .tag-lane { background: var(--gul); color: var(--lime-ink); }
.card.lane-alla .tag-lane { background: var(--bg-2); color: var(--ink); display: inline-flex; align-items: center; gap: 6px; }
.card.lane-alla .tag-lane::before { content: ""; width: 14px; height: 8px; border-radius: 2px; background: var(--alla-grad); }
.status { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em; display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.status-pagar::before, .status-oppen::before { background: var(--lime); }
.status-pagar, .status-oppen { color: var(--ink); }
.status-prelim::before, .status-planeras::before { background: transparent; border: 2px solid var(--ink-2); width: 6px; height: 6px; }
.status-installd { color: var(--clay); }
.status-installd::before { background: var(--clay); }
.card h3 { font-size: 28px; }
.when { font-family: var(--font-mono); font-size: 14px; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.when strong { color: var(--ink); font-weight: 500; }
.desc { color: var(--ink-2); }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 4px 0 0; font-size: 15px; }
.facts dt { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); padding-top: 3px; }
.facts dd { margin: 0; min-width: 0; }
.card-actions { display: flex; gap: 10px 14px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.card-note { font-size: 14px; color: var(--ink-2); }
.card-link { font-size: 15px; }

/* Förklaringar */
.explainers { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 24px 32px; margin: 0; }
.explainer { min-width: 0; border-top: 2px solid var(--ink); padding-top: 12px; }
.explainer dt { font-family: var(--font-display); font-size: 24px; font-weight: 700; text-transform: uppercase; }
.explainer dd { margin: 8px 0 0; color: var(--ink-2); }

/* Ranking */
.section-ranking { background: var(--bg-2); margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); }
.steps { list-style: none; counter-reset: steg; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 24px; }
.steps li { counter-increment: steg; display: grid; gap: 8px; min-width: 0; }
.steps li::before {
  content: counter(steg);
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 800;
  line-height: 1;
  color: var(--gold);
}
.steps h3 { font-size: 24px; }
.steps p { color: var(--ink-2); }
.ranking-note { margin-top: 28px; max-width: var(--measure); font-weight: 500; }

/* Funktionär, kontakt */
.funk-grid, .contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 20px; }
.funk-step, .contact-card { display: grid; gap: 10px; align-content: start; padding: 20px; border: 2px solid var(--line); border-radius: var(--radius); min-width: 0; }
.funk-step h3, .contact-card h3 { font-size: 22px; }
.funk-step p, .contact-card p { color: var(--ink-2); }
.funk-step .btn { justify-self: start; }
.linklist { margin: 0; padding-left: 18px; color: var(--ink-2); }
.footer { padding-top: 24px; font-size: 14px; color: var(--ink-2); }

/* Smala skärmar */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; align-items: start; }
  .wheel-wrap { max-width: 560px; }
}
@media (max-width: 760px) {
  .facts { grid-template-columns: 1fr; gap: 2px; }
  .facts dd { margin-bottom: 6px; }
}
