
:root {
  --ink:        #16293D;
  --ink-soft:   #46617C;
  --ground:     #6EC9F2;
  --ground-2:   #A8E0FA;
  --board:      #F3F7FA;
  --board-2:    #E4EDF3;
  --line:       #16293D;

  --violet:     #7A4FCB;
  --violet-ink: #FFFFFF;

  --ok:         #2F9E63;
  --near:       #E9A21C;
  --off:        #CE564B;
  --ok-ink:     #FFFFFF;
  --near-ink:   #2A1D02;
  --off-ink:    #FFFFFF;

  --shadow:     #16293D;
  --arc:        rgba(22, 41, 61, .22);

  --display: ui-rounded, "SF Pro Rounded", "Nunito", "Trebuchet MS", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --data: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink:      #EAF3FA;
    --ink-soft: #93AEC6;
    --ground:   #102133;
    --ground-2: #1A3550;
    --board:    #1B2E42;
    --board-2:  #24405A;
    --line:     #0A1520;
    --ok:       #34A96B;
    --near:     #D9971A;
    --off:      #C9524A;
    --near-ink: #1A1200;
    --shadow:   #060D15;
    --arc:      rgba(168, 224, 250, .18);
  }
}

:root[data-theme="dark"] {
  --ink:      #EAF3FA;
  --ink-soft: #93AEC6;
  --ground:   #102133;
  --ground-2: #1A3550;
  --board:    #1B2E42;
  --board-2:  #24405A;
  --line:     #0A1520;
  --ok:       #34A96B;
  --near:     #D9971A;
  --off:      #C9524A;
  --near-ink: #1A1200;
  --shadow:   #060D15;
  --arc:      rgba(168, 224, 250, .18);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

.sky {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(120% 80% at 50% -10%, var(--ground-2) 0%, transparent 60%);
  background-color: var(--ground);
}
.sky svg { width: 100%; height: 100%; display: block; }
.sky path { fill: none; stroke: var(--arc); stroke-width: 2.5; stroke-dasharray: 9 11; stroke-linecap: round; }
.sky circle { fill: none; stroke: var(--arc); stroke-width: 2; }

.wrap {
  position: relative;
  z-index: 1;
  max-width: 440px;
  margin: 0 auto;
  padding: 22px 14px calc(48px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ink {
  border: 3px solid var(--line);
  border-radius: 18px;
  box-shadow: 4px 4px 0 var(--shadow);
}

header { display: flex; flex-direction: column; gap: 9px; align-items: center; text-align: center; }

.wordmark {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.9rem, 9vw, 2.6rem);
  letter-spacing: -.02em;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.wordmark .globe { font-size: .85em; filter: drop-shadow(2px 2px 0 var(--shadow)); }

.wordmark { flex-wrap: wrap; justify-content: center; }
.wordmark .brand {
  flex-basis: 100%;
  order: -1;
  font-size: .3em;
  font-weight: 800;
  letter-spacing: .3em;
  text-indent: .3em;
  line-height: 1;
  margin-bottom: 5px;
  opacity: .68;
}

.wordmark.edition {
  position: relative;
  display: block;
  width: min(100%, 390px);
  aspect-ratio: 1000 / 252;
  margin: 0 auto;
  line-height: 0;
}
.wordmark.edition img {
  position: absolute;
  height: auto;
  filter: drop-shadow(2px 3px 0 rgba(0, 0, 0, .28));
}
.wordmark.edition .edition-logo { left: 14%; top: 0; width: 72%; }
.wordmark.edition .edition-sticker { left: 61.5%; top: 37%; width: 40%; }

body.hammarby .wordmark.edition { aspect-ratio: 1000 / 330; }
body.hammarby .wordmark.edition .edition-sticker { width: 34%; top: 27%; }
body.allsvenskan .wordmark.edition { aspect-ratio: 1000 / 280; letter-spacing: 0; }
body.allsvenskan .wordmark.edition::after { content: none; }
body.allsvenskan .wordmark.edition .edition-logo { top: 24%; }
body.allsvenskan .wordmark.edition .edition-sticker { left: 81%; width: 21%; top: 0; }
body.football.cards .wordmark.edition { aspect-ratio: 1000 / 215; }
body.football.cards .wordmark.edition .edition-sticker { width: 30%; top: 42%; }
.wordmark.edition.solo { aspect-ratio: 922 / 171; width: min(100%, 360px); }
.wordmark.edition.solo .edition-logo { left: 0; width: 100%; }
.edition-home:focus-visible { outline: none; }
.edition-home:focus-visible .edition-logo { outline: 3px solid var(--violet); outline-offset: 3px; border-radius: 10px; }

.subpage .meta { flex-wrap: wrap; justify-content: center; row-gap: 8px; }
.subpage .meta .chip { white-space: nowrap; }
.meta .chip a { color: inherit; text-underline-offset: 2px; }
.subpage .meta .chip:has(> a) { padding: 0; }
.subpage .meta .chip > a {
  display: block;
  padding: 4px 13px;
  font-family: var(--body);
  font-weight: 800;
  font-size: .86rem;
  text-decoration: none;
}

.subpage .page-title {
  margin: 2px 0 0;
  font-family: var(--display);
  font-size: clamp(1.35rem, 6vw, 1.7rem);
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--ink);
}

.meta { display: flex; gap: 8px; font-family: var(--data); font-size: .76rem; font-variant-numeric: tabular-nums; }
.chip {
  background: var(--board);
  border: 2.5px solid var(--line);
  border-radius: 999px;
  padding: 3px 11px;
  box-shadow: 2px 2px 0 var(--shadow);
}

.input-row { position: relative; }
.input-row[hidden] { display: none; }

.search {
  background: var(--board);
  padding: 13px 16px;
  font-family: var(--body);
  font-size: 1rem; 
  color: var(--ink);
  width: 100%;
}
.search::placeholder { color: var(--ink-soft); }
.search:focus-visible {
  outline: none;
  border-color: var(--violet);
  box-shadow: 4px 4px 0 var(--violet);
}

.suggestions {
  position: absolute;
  top: calc(100% + 7px);
  left: 0;
  right: 0;
  z-index: 5;
  background: var(--board);
  padding: 5px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 46vh;
  overflow-y: auto;
}
.suggestions[hidden] { display: none; }

.suggestion {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 46px; 
  padding: 8px 11px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font-family: var(--body);
  font-size: 1rem;
  text-align: start;
  cursor: pointer;
}
.suggestion.active { background: var(--violet); color: var(--violet-ink); }
.suggestion:disabled { opacity: .42; cursor: default; }
.sug-flag { font-size: 1.3rem; line-height: 1; }
.sug-name { flex: 1; font-weight: 600; }
.sug-note { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 700; }
.sug-fd { font-weight: 400; opacity: .72; }

.legend { display: flex; justify-content: center; gap: 7px; font-size: .72rem; font-weight: 700; }
.legend .tile { border-radius: 999px; padding: 2px 12px; display: block; }

#board { display: flex; flex-direction: column; gap: 14px; }

.card { background: var(--board); padding: 12px; display: flex; flex-direction: column; gap: 9px; }

.card.enter { animation: pop .22s ease-out; }
@keyframes pop {
  from { transform: translateY(-6px) scale(.985); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.card.enter .tile {
  animation: tile-in .3s cubic-bezier(.2, .7, .3, 1) backwards;
  animation-delay: calc(var(--i, 0) * 80ms + 110ms);
}
@keyframes tile-in {
  from { opacity: 0; transform: translateY(-7px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

.card-head { display: flex; align-items: center; gap: 11px; }
.flag {
  font-size: 1.8rem;
  line-height: 1;
  background: var(--board-2);
  border: 2.5px solid var(--line);
  border-radius: 12px;
  padding: 4px 7px;
  box-shadow: 2px 2px 0 var(--shadow);
}
.country {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -.01em;
  margin: 0;
  flex: 1;
  text-wrap: balance;
}
.num { font-family: var(--data); font-size: .78rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

.tiles { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.w-full  { grid-column: span 6; }
.w-half  { grid-column: span 3; }
.w-third { grid-column: span 2; }

.tile {
  border: 2.5px solid var(--line);
  border-radius: 13px;
  padding: 8px 10px;
  box-shadow: 2px 2px 0 var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.tile.ok   { background: var(--ok);   color: var(--ok-ink); }
.tile.near { background: var(--near); color: var(--near-ink); }
.tile.off  { background: var(--off);  color: var(--off-ink); }

.tile .label {
  font-size: .61rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  opacity: .85;
}
.tile .value {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 5px;
  font-variant-numeric: tabular-nums;
}
.w-third .value { font-size: .9rem; }
.w-third .label { letter-spacing: .05em; }
.tile .arrow { font-size: 1.05rem; line-height: 1; }

.levels { display: flex; flex-direction: column; gap: 1px; margin-top: 3px; }
.level { display: flex; align-items: center; gap: 7px; font-size: .84rem; font-weight: 600; }
.level.miss { opacity: .62; }
.mark {
  width: 17px; height: 17px;
  border-radius: 999px;
  display: grid; place-items: center;
  font-size: .67rem; font-weight: 800;
  flex: none;
  background: rgba(255,255,255,.9);
  color: var(--ok);
}
.level.miss .mark { background: rgba(0,0,0,.28); color: #fff; }

.win {
  background: var(--board);
  padding: 18px 16px;
  text-align: center;
  display: flex; flex-direction: column; gap: 12px; align-items: center;
}
.win > h2 { font-family: var(--display); font-weight: 800; font-size: 1.5rem; margin: 0; letter-spacing: -.01em; text-wrap: balance; }

.win .panini.card { width: 100%; text-align: start; }
.win p { margin: 0; color: var(--ink-soft); font-size: .92rem; }

.win .fact {
  background: var(--board-2);
  border: 2.5px solid var(--line);
  border-radius: 12px;
  box-shadow: 2px 2px 0 var(--shadow);
  padding: 9px 13px;
  font-size: .86rem;
  line-height: 1.45;
  text-wrap: pretty;
}

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; width: 100%; }
.stat {
  background: var(--board-2);
  border: 2.5px solid var(--line);
  border-radius: 12px;
  box-shadow: 2px 2px 0 var(--shadow);
  padding: 6px 4px;
  display: flex; flex-direction: column; gap: 1px;
  align-items: center;
}
.stat b { font-family: var(--display); font-size: 1.15rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat span { font-size: .61rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); font-weight: 700; }

.next { margin: 0; text-align: center; font-size: .9rem; color: var(--ink-soft); }
.board-note { margin: 4px 0 10px; text-align: center; font-size: .92rem; color: var(--ink-soft); }
#board:has(> .board-note) { display: flex; flex-direction: column; align-items: center; }
.next-time { font-family: var(--data); font-variant-numeric: tabular-nums; color: var(--ink); }

.btn {
  font-family: var(--display); font-weight: 800; font-size: 1rem;
  background: var(--violet); color: var(--violet-ink);
  border: 3px solid var(--line); border-radius: 14px;
  box-shadow: 4px 4px 0 var(--shadow);
  padding: 12px 26px; min-height: 46px; cursor: pointer;
  transition: transform .08s ease, box-shadow .08s ease;
}
.btn:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--shadow); }
.btn:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; }

.how { background: var(--board); padding: 13px 16px; }
.how summary {
  font-family: var(--display); font-weight: 800; font-size: 1rem;
  cursor: pointer; list-style: none; min-height: 30px; display: flex; align-items: center;
}
.how summary::-webkit-details-marker { display: none; }
.how summary::after { content: " ▾"; margin-left: auto; color: var(--ink-soft); }
.how[open] summary::after { content: " ▴"; }
.how p, .how ul,
.how-body p, .how-body ul { font-size: .89rem; color: var(--ink-soft); margin: 10px 0 0; }
.how ul, .how-body ul { padding-left: 19px; display: flex; flex-direction: column; gap: 3px; }
.how b, .how-body b { color: var(--ink); }

.faq { background: var(--board); padding: 4px 16px; }
.faq details + details { border-top: 1.5px solid var(--board-2); }
.faq summary {
  display: flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 8px 0;
  font-weight: 700; font-size: .95rem; color: var(--ink);
  cursor: pointer; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "▾"; margin-left: auto; color: var(--ink-soft); }
.faq details[open] summary::after { content: "▴"; }
.faq p { margin: 0 0 12px; font-size: .9rem; line-height: 1.5; color: var(--ink-soft); }
.faq b, .faq a { color: var(--ink); }
.faq .hs-slot { margin: 2px 0 16px; }

.hs-steps {
  display: flex; justify-content: center; gap: 6px;
  margin: 0; padding: 0; list-style: none;
}
.hs-step {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  width: 31%;
  text-align: center; font-size: .78rem; line-height: 1.3; color: var(--ink-soft);
}
.hs-step + .hs-step::before {
  content: "›";
  position: absolute; left: -9px; top: 17px;
  font-size: 1.25rem; color: var(--ink-soft);
}
.hs-icon {
  display: grid; place-items: center;
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--board-2); color: var(--ink);
}
.hs-icon svg { width: 28px; height: 28px; }
.hs-icon img { width: 44px; height: 44px; border-radius: 11px; }
.hs-four .hs-step { width: 24%; font-size: .74rem; }
.hs-four .hs-icon { width: 52px; height: 52px; }
.hs-four .hs-icon svg { width: 26px; height: 26px; }
.hs-four .hs-icon img { width: 40px; height: 40px; }
.hs-four .hs-step + .hs-step::before { left: -7px; top: 14px; }

.hs-sheet {
  position: fixed; left: 50%; top: calc(12px + env(safe-area-inset-top)); z-index: 30;
  width: min(420px, calc(100vw - 24px));
  padding: 16px 14px 16px;
  background: var(--board); color: var(--ink);
  border: 3px solid var(--line); border-radius: 22px;
  box-shadow: 4px 4px 0 var(--shadow);
  transform: translate(-50%, calc(-100% - 40px));
  transition: transform .35s cubic-bezier(.2, .8, .2, 1);
}
.hs-sheet.open { transform: translate(-50%, 0); }
.hs-sheet h2 {
  margin: 2px 40px 14px;
  text-align: center; font-family: var(--display); font-weight: 800; font-size: 1.1rem;
}
.hs-close {
  position: absolute; top: 6px; right: 6px;
  width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: transparent; color: var(--ink);
  font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.hs-close:focus-visible { outline: 3px solid var(--violet); outline-offset: -3px; }
@media (prefers-reduced-motion: reduce) { .hs-sheet { transition: none; } }

.example { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.example > .card { margin: 2px 0; }
.example-read { list-style: none; padding-left: 0; gap: 9px; }
.example-read li { display: block; }
.example .key {
  display: inline-block;
  font-size: .72rem;
  font-weight: 800;
  border: 2px solid var(--pan-rim, var(--line));
  border-radius: 999px;
  padding: 1px 9px;
  margin-right: 3px;
  vertical-align: 1px;
}
.example .key.ok   { background: var(--ok);   color: var(--ok-ink); }
.example .key.near { background: var(--near); color: var(--near-ink); }
.example .key.off  { background: var(--off);  color: var(--off-ink); }
.example .key.unknown-key { background: #5A6570; color: #fff; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 20;
  background: var(--board);
  color: var(--ink);
  border: 3px solid var(--line);
  border-radius: 14px;
  box-shadow: 4px 4px 0 var(--shadow);
  padding: 11px 18px;
  font-weight: 600;
  font-size: .9rem;
  max-width: min(92vw, 400px);
  text-align: center;
  animation: rise .18s ease-out;
}
@keyframes rise {
  from { transform: translate(-50%, 8px); opacity: 0; }
  to   { transform: translate(-50%, 0); opacity: 1; }
}

.confetti {
  position: fixed;
  inset: 0;
  z-index: 30;
  overflow: hidden;
  pointer-events: none;
}
.confetti i {
  position: absolute;
  display: block;
  animation: confetti-drift var(--t) cubic-bezier(.12, .62, .3, 1) var(--delay) both;
}
.confetti b {
  display: block;
  width: var(--w);
  height: var(--h);
  border-radius: var(--r);
  background: var(--c);
  box-shadow: 0 0 0 1.25px var(--confetti-ring, var(--line));
  animation:
    confetti-arc var(--t) var(--delay) both,
    confetti-spin var(--t) linear var(--delay) both;
}

@keyframes confetti-drift {
  from { transform: translateX(0); }
  to   { transform: translateX(var(--x)); }
}
@keyframes confetti-arc {
  0%   { transform: translateY(0); opacity: 1; animation-timing-function: cubic-bezier(.15, .7, .4, 1); }
  38%  { transform: translateY(var(--rise)); opacity: 1; animation-timing-function: cubic-bezier(.45, 0, .9, .55); }
  100% { transform: translateY(var(--fall)); opacity: 0; }
}
@keyframes confetti-spin {
  from { rotate: 0deg; }
  to   { rotate: var(--spin); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}


body.wine {
  --ink:        #2E0F1A;
  --ink-soft:   #7A505C;
  --ground:     #6E1B33;
  --ground-2:   #8E2A45;
  --board:      #FCF6F0;
  --board-2:    #F1E4D8;
  --line:       #2E0F1A;

  --violet:     #7D3C8C;
  --violet-ink: #FFFFFF;

  --shadow:     #2E0F1A;
  --arc:        rgba(252, 246, 240, .26);
}

@media (prefers-color-scheme: dark) {
  body.wine:not([data-theme="light"]) {
    --ink:      #F8EAE1;
    --ink-soft: #C6A2AA;
    --ground:   #2A0A14;
    --ground-2: #3E1220;
    --board:    #33161F;
    --board-2:  #44212B;
    --line:     #170509;
    --ok:       #34A96B;
    --near:     #D9971A;
    --off:      #C9524A;
    --near-ink: #1A1200;
    --shadow:   #0F0305;
    --arc:      rgba(248, 234, 225, .16);
  }
}

body.wine[data-theme="dark"] {
  --ink:      #F8EAE1;
  --ink-soft: #C6A2AA;
  --ground:   #2A0A14;
  --ground-2: #3E1220;
  --board:    #33161F;
  --board-2:  #44212B;
  --line:     #170509;
  --ok:       #34A96B;
  --near:     #D9971A;
  --off:      #C9524A;
  --near-ink: #1A1200;
  --shadow:   #0F0305;
  --arc:      rgba(248, 234, 225, .16);
}

body.wine .sky circle { fill: var(--arc); stroke: none; }
body.wine .sky .sun   { fill: none; stroke: var(--arc); stroke-width: 2.5; }


body.football {
  --ink:        #E8F5E4;
  --ink-soft:   #93B49C;
  --ground:     #12281B;
  --ground-2:   #1B3A26;
  --board:      #1B3324;
  --board-2:    #26452F;
  --line:       #0A1A11;
  --ok:         #34A96B;
  --near:       #D9971A;
  --off:        #C9524A;
  --near-ink:   #1A1200;

  --violet:     #3B7DD8;
  --violet-ink: #FFFFFF;

  --confetti: #E23B34, #F0821E, #F5C518, #21A05A, #2C74D6, #7A4FCB;

  --shadow:     #06110A;
  --arc:        rgba(232, 245, 228, .16);
}

body.football .search:focus-visible {
  border-color: var(--line);
  box-shadow: 4px 4px 0 var(--shadow);
}

body.football .sky {
  background:
    radial-gradient(120% 80% at 50% -10%, var(--ground-2) 0%, transparent 60%),
    repeating-linear-gradient(90deg,
      rgba(255, 255, 255, .05) 0 44px,
      rgba(0, 0, 0, .045) 44px 88px);
  background-color: var(--ground); 
}

body.football .sky path   { stroke-dasharray: none; stroke-width: 2.5; }
body.football .sky circle { fill: none; stroke: var(--arc); stroke-width: 2.5; }
body.football .sky .spot  { fill: var(--arc); stroke: none; }

body.football .card.enter .tile {
  animation-duration: .42s;
  animation-delay: calc(var(--i, 0) * 155ms + 140ms);
}

body.allsvenskan {
  --ink:        #F1F7FC;
  --ink-soft:   #A9C4DE;
  --ground:     #0C2340;
  --ground-2:   #17406F;
  --board:      #16375D;
  --board-2:    #1E4877;
  --line:       #04101F;

  --ok:         #34A96B;
  --near:       #DE8A11;
  --off:        #C9524A;
  --near-ink:   #1A1200;

  --violet:     #EBC96A;
  --violet-ink: #0A1F3A;

  --confetti: #EBC96A, #C9A44A, #F5E3AE;

  --shadow:     #04101F;
  --arc:        rgba(235, 201, 106, .40);

  --gold:       #C9A44A;

  --display: "SF Compact Display", "Roboto Condensed", "Arial Narrow",
             "Helvetica Neue", ui-sans-serif, system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  body.allsvenskan:not([data-theme="light"]) {
    --ink:      #E7F1FA;
    --ink-soft: #93B2CF;
    --ground:   #06172E;
    --ground-2: #0F2E52;
    --board:    #102C4C;
    --board-2:  #173A61;
    --line:     #020A14;
    --near:     #D08210;
    --shadow:   #020A14;
    --arc:      rgba(201, 164, 74, .32);
    --gold:     #B8934099;
  }
}

body.allsvenskan[data-theme="dark"] {
  --ink:      #E7F1FA;
  --ink-soft: #93B2CF;
  --ground:   #06172E;
  --ground-2: #0F2E52;
  --board:    #102C4C;
  --board-2:  #173A61;
  --line:     #020A14;
  --near:     #D08210;
  --shadow:   #020A14;
  --arc:      rgba(201, 164, 74, .32);
  --gold:     #B8934099;
}

body.allsvenskan .sky {
  background:
    radial-gradient(120% 85% at 50% -10%, var(--ground-2) 0%, transparent 62%),
    linear-gradient(90deg,
      rgba(0, 0, 0, .07) 0 22px,
      rgba(255, 255, 255, .035) 22px 66px,
      rgba(0, 0, 0, .07) 66px 88px) center top / 88px 100% repeat-x;
  background-color: var(--ground); 
}

body.allsvenskan .sky path   { stroke-dasharray: none; stroke-width: 2.5; }
body.allsvenskan .sky circle { fill: none; stroke: var(--arc); stroke-width: 2.5; }
body.allsvenskan .sky .spot  { fill: var(--arc); stroke: none; }

body.allsvenskan .wordmark {
  flex-wrap: wrap;
  justify-content: center;
  letter-spacing: .045em;
  font-stretch: condensed;
}
body.allsvenskan .wordmark::after {
  content: "";
  flex-basis: 100%;
  width: 100%;
  max-width: 208px;
  height: 3px;
  margin: 8px auto 0;
  background: var(--gold);
  border-radius: 2px;
}

body.allsvenskan .chip { border-color: var(--gold); }

body.allsvenskan .card.enter .tile {
  animation-duration: .42s;
  animation-delay: calc(var(--i, 0) * 155ms + 140ms);
}

body.england {
  --ink:        #E9E4D3;
  --ink-soft:   #C9C3B3;
  --ground:     #0B1D30;
  --ground-2:   #13263D;
  --board:      #0B1C2E;
  --board-2:    #13283E;
  --line:       #E9E4D3;

  --violet:     #C8102E;
  --violet-ink: #FFFFFF;

  --confetti: #C8102E, #FFFFFF, #E9E4D3, #9B0C24;

  --shadow:     rgba(2, 8, 16, .55);
  --arc:        rgba(233, 228, 211, .36);

  --pan-rim:    #0B1D30;

  --body: "Avenir Next", Avenir, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: var(--body);

  display: flex;
  flex-direction: column;
  min-height: 100svh;
}

body.england .sky {
  background:
    url("/web/assets/england-grain.webp") 0 0 / 256px 256px repeat,
    radial-gradient(120% 75% at 50% 52%, transparent 58%, rgba(40, 62, 92, .35) 100%),
    linear-gradient(180deg, #13263D 0%, #0D2034 26%, #0B1D30 48%);
  background-color: var(--ground);
}
body.england .sky svg { display: none; }

body.england main.wrap {
  overflow-x: clip;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  width: 100%;
  box-sizing: border-box;
  padding: 36px 14px 0;
}

body.england .pitch {
  position: absolute;
  top: 0;
  left: 50%;
  width: 390px;
  height: 844px;
  transform: translateX(-50%);
  z-index: -1;
  pointer-events: none;
}
body.england .pitch path,
body.england .pitch circle { fill: none; stroke: var(--arc); stroke-width: 1.3; }

body.england header { gap: 26px; }
body.england .wordmark.edition { width: min(80.72%, 314.8px); aspect-ratio: 362 / 87; }
body.england .wordmark.edition .edition-logo { left: 5.4%; top: -7.1%; width: 89.2%; }
body.england .wordmark.edition .edition-sticker { left: 16.065%; top: 57.9%; width: 67.87%; filter: none; }

body.england .meta { gap: 12.2px; font-size: .72rem; font-weight: 600; }
body.england #puzzle { min-width: 63.4px; justify-content: center; }
body.england #counter { min-width: 148px; justify-content: center; }
@media (max-width: 379px) {
  body.england .meta { gap: 8px; flex-wrap: wrap; justify-content: center; row-gap: 8px; }
  body.england #puzzle, body.england #counter { min-width: 0; }
}
@media (max-width: 340px) {
  body.england .meta::after { content: ""; flex-basis: 100%; order: 1; }
  body.england .meta .icon-chip { order: 2; }
}
body.england .chip {
  height: 31px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-width: 2.6px;
  box-shadow: 0 2px 6px var(--shadow);
}
body.england .icon-chip { width: 31px; padding: 0; justify-content: center; font-size: .95rem; font-weight: 700; }

body.england .expert-switch {
  position: absolute;
  top: 10px;
  left: max(14px, calc(50% - 181px));
  width: 51px;
  height: 31px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #C9C9CE;
  box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, .06), 0 2px 6px var(--shadow);
  cursor: pointer;
  transition: background-color .2s;
}
body.england .expert-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 1px 1px rgba(0, 0, 0, .16), 0 3px 1px rgba(0, 0, 0, .1);
  transition: transform .2s;
}
body.england .expert-switch[aria-checked="true"] { background: #34C759; }
body.england .expert-switch[aria-checked="true"] .expert-knob { transform: translateX(20px); }
body.england .expert-switch:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  body.england .expert-switch, body.england .expert-knob { transition: none; }
}

body.england .wordmark.edition .expert-sticker { left: 66.95%; top: -32.4%; width: 28.1%; transform: rotate(-7deg); }
body.england .wordmark.edition .expert-sticker[hidden] { display: none; }
body.england .wrap { gap: 12px; }
body.england .ink { border-width: 2.7px; border-radius: 21px; box-shadow: 0 3px 8px var(--shadow); }
body.england .search { height: 51px; box-sizing: border-box; padding: 0 19px; font-size: 1.03rem; }
body.england .search::placeholder { color: #B9BDC2; }

body.england .legend { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body.england .legend .tile { border-color: var(--pan-rim); }
body.england .legend { position: relative; }
body.england .legend::before,
body.england .legend::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
}
body.england .legend::before {
  left: 50%;
  top: calc(90.05px - 48.75px);
  width: 97.5px;
  height: 97.5px;
  margin-left: -48.75px;
  box-sizing: border-box;
  border: 1.3px solid var(--arc);
  border-radius: 50%;
}
body.england .legend::after {
  left: -100vw;
  right: -100vw;
  top: calc(90.05px - .65px);
  height: 1.3px;
  background: var(--arc);
}

body.england #end:empty,
body.england #board:empty { display: none; }

body.england .how { margin-top: 24.5px; padding: 9.75px 22px 9.75px 19px; }
body.england .how summary { font-weight: 700; font-size: 1.02rem; letter-spacing: 0; }
body.england .how summary::after { content: "▼"; font-size: .62rem; color: var(--ink); }
body.england .how[open] summary::after { content: "▲"; }
body.england .how p,
body.england .how ul { color: var(--ink-soft); }
body.england .how .example > .card { margin-inline: -2.5px -5.5px; }

body.england .site-foot {
  margin-top: auto;
  padding-top: 0;
  gap: 4px;
  font-size: .8rem;
  color: var(--ink);
  position: relative;
  z-index: 1;
}
body.england .colophon::before { content: none; }
body.england .site-foot .foot-note { max-width: 235px; margin: 9px auto 0; opacity: 1; line-height: 1.47; text-wrap: wrap; }
body.england .site-foot .sep { opacity: .7; }
body.england .site-foot a[href="/villkor"] { text-decoration: none; }

body.england .stands {
  flex: none;
  width: 100%;
  max-width: 600px;
  margin: -77px auto 0;
  aspect-ratio: 1170 / 913;
  background: url("/web/assets/england-stands.webp") center top / 100% auto no-repeat;
  pointer-events: none;
  position: relative;
  z-index: 0;
}
@media (min-width: 601px) {
  body.england .stands {
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
  }
}

body.england .search:focus-visible {
  border-color: var(--line);
  box-shadow: 0 3px 8px var(--shadow);
}

body.england .card.enter .tile {
  animation-duration: .42s;
  animation-delay: calc(var(--i, 0) * 155ms + 140ms);
}

body.djurgarden {
  --ink:        #0B2136;
  --ink-soft:   #40637F;
  --ground:     #8FB8DC;
  --ground-2:   #AFCDE9;
  --board:      #F5F9FD;
  --board-2:    #E4EDF6;
  --line:       #0B2136;

  --violet:     #14538C;
  --violet-ink: #FFFFFF;


  --confetti: #FCE430, #D81824, #0060A8;

  --shadow:     #0B2136;
  --arc:        rgba(255, 255, 255, .55);

  --stripe-light: #76BBF2;
  --stripe-dark:  #0A184B;
  --stripe-w: clamp(42px, 5vw, 78px);
  --deco:         rgba(255, 255, 255, .78);
  --deco-fill:    rgba(255, 255, 255, .34);
}

@media (prefers-color-scheme: dark) {
  body.djurgarden:not([data-theme="light"]) {
    --ink:      #DCEBF8;
    --ink-soft: #85A5BF;
    --ground:   #0B1B2B;
    --ground-2: #132B41;
    --board:    #14283A;
    --board-2:  #1F384C;
    --line:     #050F19;
    --shadow:   #030A11;
    --arc:      rgba(220, 235, 248, .16);
    --stripe-light: #3E7CB0;
    --stripe-dark:  #070F2E;
    --deco:         rgba(190, 220, 245, .40);
    --deco-fill:    rgba(190, 220, 245, .16);
  }
}

body.djurgarden[data-theme="dark"] {
  --ink:      #DCEBF8;
  --ink-soft: #85A5BF;
  --ground:   #0B1B2B;
  --ground-2: #132B41;
  --board:    #14283A;
  --board-2:  #1F384C;
  --line:     #050F19;
  --shadow:   #030A11;
  --arc:      rgba(220, 235, 248, .16);
  --stripe-light: #3E7CB0;
  --stripe-dark:  #070F2E;
  --deco:         rgba(190, 220, 245, .40);
  --deco-fill:    rgba(190, 220, 245, .16);
}

body.djurgarden .sky {
  background:
    repeating-linear-gradient(90deg,
      var(--stripe-light) 0 var(--stripe-w),
      var(--stripe-dark) var(--stripe-w) calc(var(--stripe-w) * 2));
  background-color: var(--stripe-dark); 
}
body.djurgarden {
  background:
    repeating-linear-gradient(90deg,
      var(--stripe-light) 0 var(--stripe-w),
      var(--stripe-dark) var(--stripe-w) calc(var(--stripe-w) * 2));
  background-color: var(--stripe-dark);
}

html:has(body.djurgarden) { overflow-x: clip; }

body.djurgarden .dg-scene {
  position: relative;
  z-index: 0;
  margin: 4px 0 0;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  display: flex;
  justify-content: center;
  pointer-events: none;
}

body.djurgarden .dg-stadion {
  width: min(880px, 128vw);
  height: auto;
  display: block;
}

body.djurgarden .input-row { margin-top: clamp(-96px, -13vw, -56px); }

body.djurgarden .wash-sky         { fill: rgba(214, 236, 252, .55); }
body.djurgarden .wash-brick       { fill: rgba(198, 116, 84, .78); }
body.djurgarden .wash-brick-light { fill: rgba(224, 152, 116, .60); }
body.djurgarden .wash-brick-dark  { fill: rgba(150, 76, 56, .72); }
body.djurgarden .wash-shade       { fill: rgba(92, 48, 40, .55); }
body.djurgarden .wash-roof        { fill: rgba(120, 62, 48, .80); }
body.djurgarden .wash-copper      { fill: rgba(112, 176, 152, .85); }
body.djurgarden .wash-copper-face { fill: rgba(238, 240, 232, .80); }
body.djurgarden .ink-hand         { stroke: rgba(60, 46, 40, .85); stroke-width: 2.5; fill: none; stroke-linecap: round; }
body.djurgarden .wash-leaf        { fill: rgba(126, 164, 90, .72); }
body.djurgarden .wash-leaf-dark   { fill: rgba(88, 128, 68, .72); }
body.djurgarden .wash-track       { fill: rgba(206, 118, 86, .58); }


body.djurgarden .dg-shade {
  fill: rgba(10, 24, 75, .30);
  filter: blur(6px);
}

body.djurgarden .dg-kamin,
body.djurgarden .dg-hare {
  overflow: visible;
  filter: drop-shadow(0 3px 5px rgba(10, 24, 75, .30));
}

body.djurgarden .dg-stadion { width: min(880px, 128vw); }

@media (prefers-color-scheme: dark) {
  body.djurgarden:not([data-theme="light"]) .dg-kamin,
  body.djurgarden:not([data-theme="light"]) .dg-hare { opacity: .94; }
  body.djurgarden:not([data-theme="light"]) .dg-shade { fill: rgba(0, 0, 0, .34); }
}
body.djurgarden[data-theme="dark"] .dg-kamin,
body.djurgarden[data-theme="dark"] .dg-hare { opacity: .94; }
body.djurgarden[data-theme="dark"] .dg-shade { fill: rgba(0, 0, 0, .34); }

body.djurgarden header { gap: 12px; }
body.djurgarden .wordmark { gap: 0; }

body.djurgarden .wrap { padding-top: 20px; }


body.djurgarden .colophon {
  color: #FFFFFF;
  text-shadow:
    -1px -1px 0 var(--stripe-dark), 1px -1px 0 var(--stripe-dark),
    -1px 1px 0 var(--stripe-dark), 1px 1px 0 var(--stripe-dark),
    0 0 4px var(--stripe-dark);
}
body.djurgarden .colophon .foot-mail svg {
  filter:
    drop-shadow(1px 0 0 var(--stripe-dark)) drop-shadow(-1px 0 0 var(--stripe-dark))
    drop-shadow(0 1px 0 var(--stripe-dark)) drop-shadow(0 -1px 0 var(--stripe-dark));
}

@media (max-width: 620px) {
  body.djurgarden .dg-stadion { width: 100vw; }
  body.djurgarden .input-row  { margin-top: -9vw; }
}

body.djurgarden .card.enter .tile {
  animation-duration: .42s;
  animation-delay: calc(var(--i, 0) * 155ms + 140ms);
}

.flag.portrait {
  width: 64px;
  height: 64px;
  padding: 0;
  border-radius: 999px;
  overflow: hidden;
  display: grid;
  place-items: center;
  flex: none;
  object-position: top;
}
.flag.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }

.reveal-portrait {
  width: 132px;
  height: 132px;
  margin: 0 auto 6px;
  display: block;
}

.credits-intro {
  background: var(--board);
  padding: 14px 16px;
  font-size: .92rem;
  line-height: 1.5;
}
.credits-intro p { margin: 0 0 8px; }
.credits-intro p:last-child { margin-bottom: 0; }
.credits-intro #licence-summary { color: var(--ink-soft); font-size: .85rem; }

#credits { display: flex; flex-direction: column; gap: 8px; }

.credit {
  background: var(--board);
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 11px;
  border-radius: 14px;
  border-width: 2.5px;
  box-shadow: 3px 3px 0 var(--shadow);
}
.credit-thumb {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 999px;
  border: 2.5px solid var(--line);
  object-fit: cover;
  object-position: top center;
  background: var(--board-2);
}
.credit-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; font-size: .82rem; }
.credit-text b { font-family: var(--display); font-size: .95rem; }
.credit-text span { color: var(--ink-soft); overflow-wrap: anywhere; }
.credits-empty { background: var(--board); padding: 14px 16px; text-align: center; }

.credits-section {
  font-family: var(--display);
  font-size: 1.05rem;
  margin: 14px 0 0;
  border: none;
  background: none;
  box-shadow: none;
  padding: 0;
}
.credits-section:first-child { margin-top: 0; }
.credits-note {
  margin: 0 0 2px;
  font-size: .82rem;
  line-height: 1.45;
  color: var(--ink-soft);
  border: none;
  background: none;
  box-shadow: none;
  padding: 0;
}

.colophon {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 11px;
  text-align: center;
  font-size: .8rem;
  color: var(--ink-soft);
}

.colophon::before {
  content: "";
  width: 44px;
  height: 2px;
  margin: 2px auto 1px;
  border-radius: 2px;
  background: currentColor;
  opacity: .35;
}

.colophon section { display: flex; flex-direction: column; gap: 3px; }

.colophon h2 {
  margin: 0;
  font-family: var(--display);
  font-size: .66rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .13em;
  opacity: .75;
}

.colophon p {
  margin: 0;
  line-height: 1.5;
  text-wrap: balance;
  hyphens: none;
}

.colophon .sep { opacity: .5; padding-right: .3em; }

.colophon .lic { white-space: nowrap; }

.colophon.site-foot { gap: 5px; font-size: .78rem; }
.site-foot .sep { padding: 0 .6em; opacity: .45; }
.site-foot .foot-brand b { font-weight: 700; }
.site-foot .foot-mail {
  display: inline-flex;
  vertical-align: -4px;
  text-decoration: none;
}
.site-foot .foot-mail svg { display: block; }
.site-foot .foot-note { opacity: .88; }
.site-foot a { padding-block: 5px; }
.site-foot .foot-mail { padding: 7px; margin: -7px; }

.colophon a,
.credits-intro a,
.legal a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal {
  background: var(--board);
  padding: 18px 20px;
  font-size: .92rem;
  line-height: 1.6;
}
.legal h2 {
  font-family: var(--display);
  font-size: 1.25rem;
  margin: 26px 0 10px;
  padding-top: 18px;
  border-top: 2.5px dashed var(--line);
}
.legal h2:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.legal h3 {
  font-family: var(--display);
  font-size: 1rem;
  margin: 18px 0 4px;
}
.legal p { margin: 0 0 10px; }
.legal code {
  font-family: var(--data);
  font-size: .85em;
  background: var(--board-2);
  padding: 1px 5px;
  border-radius: 6px;
}
.legal-updated { color: var(--ink-soft); font-size: .82rem; margin-top: 20px; }
.legal details { border-top: 1.5px solid var(--board-2); }
.legal details:has(+ :not(details)) { border-bottom: 1.5px solid var(--board-2); margin-bottom: 10px; }
.legal summary {
  display: flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 8px 0;
  font-family: var(--display); font-weight: 700; font-size: 1rem;
  cursor: pointer; list-style: none;
}
.legal summary::-webkit-details-marker { display: none; }
.legal summary::after { content: "▾"; margin-left: auto; color: var(--ink-soft); }
.legal details[open] summary::after { content: "▴"; }
.legal details[open] { padding-bottom: 4px; }


body.aik {
  --ink:        #F4F1E4;
  --ink-soft:   #A09A86;
  --ground:     #000000;
  --ground-2:   #000000;
  --board:      #1C1B12;
  --board-2:    #292718;
  --line:       #000000;

  --violet:     #FFDD00;
  --violet-ink: #000000;

  --confetti:      #FFDD00, #000000;
  --confetti-ring: var(--aik-gold);

  --ok:         #35A96C;
  --near:       #D9971A;
  --off:        #C9524A;
  --ok-ink:     #FFFFFF;
  --near-ink:   #1A1200;
  --off-ink:    #FFFFFF;

  --shadow:     #2E2716;
  --arc:        rgba(255, 221, 0, .13);

  --aik-yellow: #FFDD00;
  --aik-gold:   #9B8456;
}

body.aik .sky { background: var(--ground); }

body.aik header { position: relative; overflow-x: clip; }
body.aik header::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -96px;
  width: min(680px, 132vw);
  height: 420px;
  transform: translateX(-50%);
  background: radial-gradient(50% 50% at 50% 36%,
    rgba(255, 242, 198, .17) 0%,
    rgba(255, 221, 0, .07) 40%,
    transparent 72%);
  pointer-events: none;
  z-index: -1;
}


body.aik .wordmark.edition { aspect-ratio: 1000 / 330; }
body.aik .wordmark.edition .edition-sticker { width: 32%; top: 26%; }

body.aik header { gap: 13px; }

html:has(body.aik) { overflow-x: clip; }

body.aik .aik-scene {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  display: flex;
  justify-content: center;
  pointer-events: none;
}

body.aik .aik-stadium {
  position: relative;
  width: min(1120px, 100vw);
  height: clamp(224px, 24vw, 300px);
  overflow: hidden;
}

body.aik .aik-rasunda {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 38%;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%);
}

body.aik .aik-gnaget {
  position: absolute;
  left: 12%;
  bottom: 3%;
  width: clamp(56px, 11%, 118px);
  height: auto;
}

body.aik .card,
body.aik .how,
body.aik .search,
body.aik .toast { border-color: rgba(155, 132, 86, .34); }
body.aik .chip  { border-color: rgba(155, 132, 86, .5); }

body.aik .card.enter .tile {
  animation-duration: .42s;
  animation-delay: calc(var(--i, 0) * 155ms + 140ms);
}


body.hammarby {
  --ink:        #06271A;
  --ink-soft:   #4A6B5B;
  --ground:     #FFFFFF;
  --ground-2:   #EEF6F1; 
  --board:      #FFFFFF;
  --board-2:    #EDF5F0;
  --line:       #06271A;

  --violet:     #C79A00;
  --violet-ink: #1B1300;

  --confetti:   #007A43, #FFFFFF, #FFCC00;

  --ok:         #2F9E63;
  --near:       #D9971A;
  --off:        #CE564B;
  --ok-ink:     #FFFFFF;
  --near-ink:   #2A1D02;
  --off-ink:    #FFFFFF;

  --shadow:     #06271A;
  --arc:        rgba(6, 39, 26, .16);

  --bajen-green:  #007A43;
  --bajen-yellow: #FFCC00;
}

@media (prefers-color-scheme: dark) {
  body.hammarby:not([data-theme="light"]) {
    --ink:      #EAF3ED;
    --ink-soft: #8FAE9E;
    --ground:   #011E13; 
    --ground-2: #04301F;
    --board:    #0A2E1F;
    --board-2:  #12402C;
    --line:     #01120B;
    --violet:     #FFCC00;
    --violet-ink: #06271A;
    --shadow:   #01120B;
    --arc:      rgba(255, 204, 0, .12);
  }
}
body.hammarby[data-theme="dark"] {
  --ink:      #EAF3ED;
  --ink-soft: #8FAE9E;
  --ground:   #011E13;
  --ground-2: #04301F;
  --board:    #0A2E1F;
  --board-2:  #12402C;
  --line:     #01120B;
  --violet:     #FFCC00;
  --violet-ink: #06271A;
  --shadow:   #01120B;
  --arc:      rgba(255, 204, 0, .12);
}

body.hammarby .sky {
  background:
    repeating-linear-gradient(
      180deg,
      var(--bajen-green) 0 13px,
      transparent 13px 26px
    ) no-repeat top / 100% 78px,
    radial-gradient(120% 80% at 50% -10%, var(--ground-2) 0%, transparent 60%);
  background-color: var(--ground); 
}

body.hammarby .wrap { padding-top: 96px; }
body.hammarby .sky path,
body.hammarby .sky circle { stroke: var(--arc); }

body.hammarby header { gap: 12px; }

body.hammarby .wordmark { margin: 0; line-height: 0; gap: 0; }
body.hammarby .wordmark img { width: clamp(150px, 42vw, 224px); }

html:has(body.hammarby) { overflow-x: clip; }

body.hammarby .hammarby-scene {
  --aerial-w: min(440px, 38vw);
  --figure-w: clamp(108px, 12.5vw, 164px);

  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}

body.hammarby .hammarby-aerial {
  width: var(--aerial-w);
  height: auto;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(6, 39, 26, .22);
}

body.hammarby .bajen-flaggan,
body.hammarby .bajen-loparen {
  position: absolute;
  bottom: 0;
  height: auto;
  z-index: 1;
  filter: drop-shadow(0 8px 10px rgba(6, 39, 26, .30));
}

body.hammarby .bajen-flaggan {
  left: calc(50% + var(--aerial-w) / 2 - var(--figure-w) * .08);
  width: calc(var(--figure-w) * .96);
}

body.hammarby .bajen-loparen {
  right: calc(50% + var(--aerial-w) / 2 - var(--figure-w) * .08);
  width: var(--figure-w);
}

@media (max-width: 900px) {
  body.hammarby .hammarby-scene {
    --aerial-w: min(300px, 46vw);
    --figure-w: clamp(54px, 17vw, 96px);
  }
}

body.hammarby .card,
body.hammarby .how,
body.hammarby .search,
body.hammarby .toast { border-color: rgba(0, 122, 67, .30); }
body.hammarby .chip { border-color: rgba(0, 122, 67, .45); }

body.hammarby .card.enter .tile {
  animation-duration: .42s;
  animation-delay: calc(var(--i, 0) * 155ms + 140ms);
}

.panini.card {
  aspect-ratio: 1024 / 1536;
  position: relative;
  padding: 0;
  gap: 0;
  background: none;
  border: 0;
  box-shadow: none;
  overflow: visible;

  container-type: inline-size;

  --pan-unknown: #5A6570;
  --pan-ink:     #12151C;

  --pan-display: "Arial Narrow", "Helvetica Neue Condensed", "Roboto Condensed",
                 "Liberation Sans Narrow", "Franklin Gothic Medium", system-ui, sans-serif;

  --pan-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-family: var(--pan-body);
}

.panini.card::before {
  content: "";
  position: absolute;
  inset: 2.21% 3.32%;
  border-radius: 3.9cqw;
  background: #EDE4CE;
  z-index: 0;
  pointer-events: none;
}

.panini .pan-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
  pointer-events: none;
}

.panini .pan-photo {
  position: absolute;
  left: 6.15%;
  top: 5.27%;
  width: 87.21%;
  height: 48.11%;
  z-index: 0;
  overflow: hidden;
  border-radius: 3.2cqw;
  display: grid;
  place-items: center;
  background: #0A1B3D;
}
.panini.rows8 .pan-photo { height: 43.42%; }
.panini.rows8 .pan-name { top: 48.76%; }
.panini .pan-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.panini .pan-photo.empty {
  background:
    repeating-linear-gradient(90deg,
      var(--pan-blank-a, #E6DCC6) 0 var(--pan-blank-w, 5.2cqw),
      var(--pan-blank-b, #C9BC9F) var(--pan-blank-w, 5.2cqw) calc(var(--pan-blank-w, 5.2cqw) * 2));
}

.panini .pan-photo-mark {
  font-family: var(--pan-display);
  font-stretch: 75%;
  font-weight: 800;
  font-size: 12.5cqw;
  line-height: 1;
  letter-spacing: .05em;
  color: #F6EEDC;
  -webkit-text-stroke: 1.1cqw var(--pan-ink);
  paint-order: stroke fill;
  text-shadow: .9cqw .9cqw 0 rgba(18, 21, 28, .45);
  transform: rotate(-8deg);
  user-select: none;
}
.panini .pan-photo img.pan-photo-mark {
  width: 66%;
  height: auto;
  object-fit: contain;
  transform: rotate(-8deg);
}

.panini .pan-name {
  position: absolute;
  left: 6.15%;
  top: 53.45%;
  width: 87.21%;
  height: 6.25%;
  z-index: 2;
  margin: 0;
  display: grid;
  place-items: center;
  text-align: center;
  font-family: var(--pan-display);
  font-stretch: 80%;
  font-weight: 700;
  font-size: 5.1cqw;
  line-height: 1;
  letter-spacing: .005em;
  text-transform: uppercase;
  text-wrap: balance;
  color: var(--pan-ink);
  overflow: hidden;
}

.panini .pan-num {
  position: absolute;
  right: 5.2%;
  top: 1.9%;
  z-index: 2;
  font-family: var(--data);
  font-size: 2.7cqw;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--pan-ink);
}

.panini .pan-row {
  position: absolute;
  left: 13.38%;
  width: 78.87%;
  top: var(--y);
  transform: translateY(-50%);
  z-index: 2;
  display: grid;
  grid-template-columns: 28.19% 50.12% 21.69%;
  align-items: center;
  column-gap: 0;
  color: var(--pan-ink);
}
.panini { direction: ltr; }
.panini .pan-label { unicode-bidi: plaintext; }

.panini .pan-label {
  font-family: var(--pan-display);
  font-stretch: 85%;
  font-weight: 700;
  font-size: 3.5cqw;
  letter-spacing: .02em;
  text-transform: uppercase;
  white-space: nowrap;
  padding-left: 1.8cqw;
}

.panini .pan-value {
  font-size: 3.4cqw;
  font-weight: 600;
  text-align: center;
  line-height: 1.1;
  overflow-wrap: anywhere;
  unicode-bidi: plaintext;
}
.panini .pan-nowrap { white-space: nowrap; }

.panini .pan-verdict {
  grid-column: 3;
  height: 5.6cqw;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .8cqw;
  padding: 0;
  border: .65cqw solid var(--pan-rim, var(--line));
  border-radius: 1.55cqw;
  font-family: var(--pan-display);
  font-stretch: 85%;
  font-weight: 700;
  font-size: 3.2cqw;
  line-height: 1.05;
  letter-spacing: .03em;
  text-align: center;
  color: var(--ok-ink);
}
.panini .pan-row.ok      .pan-verdict { background: var(--ok); }
.panini .pan-row.near    .pan-verdict { background: var(--near); color: var(--near-ink); }
.panini .pan-row.off     .pan-verdict { background: var(--off); }
.panini .pan-row.unknown .pan-verdict { background: var(--pan-unknown); }
.panini .pan-row.unknown .pan-value   { font-style: italic; opacity: .78; }

.panini .pan-arrow {
  font-family: var(--pan-body);
  font-size: 1.1em;
  line-height: 1;
  font-weight: 700;
  color: inherit;
}

.panini.card.enter {
  animation: pan-flip .78s cubic-bezier(.24, .62, .3, 1) backwards;
  transform-origin: 50% 50%;
  backface-visibility: hidden;
}
@keyframes pan-flip {
  from {
    transform: perspective(1200px) translateY(-14px) rotateY(-90deg) scale(.94);
  }
  to {
    transform: perspective(1200px) translateY(0) rotateY(0deg) scale(1);
  }
}

.panini.card.enter .pan-row {
  animation: pan-row-in .3s cubic-bezier(.2, .7, .3, 1) backwards;
  animation-delay: calc(var(--i, 0) * 52ms + 660ms);
}

@keyframes pan-row-in {
  from { opacity: 0; transform: translateY(calc(-50% - 7px)) scale(.97); }
  to   { opacity: 1; transform: translateY(-50%); }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}



body.cards .wrap { max-width: clamp(440px, min(52vw, 56vh), 640px); }

body.cards,
body.cards[data-theme] {
  --ok:       #23874F;
  --near:     #E9A21C;
  --off:      #B4392F;
  --ok-ink:   #FFFFFF;
  --near-ink: #2A1D02;
  --off-ink:  #FFFFFF;
}
@media (prefers-color-scheme: dark) {
  body.cards:not([data-theme="light"]) {
    --ok:       #23874F;
    --near:     #E9A21C;
    --off:      #B4392F;
    --ok-ink:   #FFFFFF;
    --near-ink: #2A1D02;
    --off-ink:  #FFFFFF;
  }
}

body.djurgarden { --pan-blank-a: #8BB6DA; --pan-blank-b: #2B3F70; }
body.aik        { --pan-blank-a: #E0C44A; --pan-blank-b: #23221F; }
body.hammarby   { --pan-blank-a: #3A8A63; --pan-blank-b: #EEF0E8; }
body.football    { --pan-blank-a: #86C764; --pan-blank-b: #5F9F46; }
body.allsvenskan { --pan-blank-a: #C4A457; --pan-blank-b: #1B3558; }
body.england     { --pan-blank-a: #E9E4D3; --pan-blank-b: #0B1D30; }

body.start .start-lede {
  margin: 8px auto 0;
  max-width: 34ch;
  text-align: center;
  font-family: var(--display);
  font-size: clamp(1.15rem, 5vw, 1.35rem);
  font-weight: 800;
  letter-spacing: .01em;
  line-height: 1.3;
  color: var(--ink);
}
body.start .start-sections { display: flex; flex-direction: column; gap: 26px; margin-top: 24px; }
body.start .start-list { display: grid; gap: 12px; }
body.start .start-list h2 {
  margin: 0 0 2px;
  text-align: center;
  font-size: .78rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink);
}
body.start .start-game {
  display: grid;
  gap: 2px;
  padding: 14px 18px;
  background: var(--board);
  color: var(--ink);
  text-decoration: none;
  transition: transform .12s ease, box-shadow .12s ease;
}
body.start .start-game:hover,
body.start .start-game:focus-visible { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--shadow); }
body.start .start-game:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--shadow); }
body.start .start-name { font-weight: 800; font-size: 1.15rem; }
body.start .start-desc { font-size: .92rem; color: var(--ink-soft); }
body.start .notfound-text {
  margin-top: 4px;
  font-family: var(--body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--on-ground-soft);
}

body.football.start,
body.football.subpage {
  --ink:            #14331F;
  --ink-soft:       #4E7358;
  --ground:         #24563A;
  --ground-2:       #2C6644;
  --board:          #F5FAF3;
  --board-2:        #E6F0E2;
  --line:           #0E2416;
  --shadow:         #0B1F12;
  --arc:            rgba(255, 255, 255, .13);
  --on-ground:      #F1F7F2;
  --on-ground-soft: #C4DACB;
}
body.start .start-lede,
body.start .start-list h2,
body.subpage .page-title { color: var(--on-ground); }
body.start .colophon,
body.subpage .colophon { color: var(--on-ground-soft); }
body.subpage .credits-section { color: var(--on-ground); }
body.subpage .credits-note { color: var(--on-ground-soft); }

.icon-chip {
  width: 29px;
  height: 29px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  font: inherit;
  font-family: var(--display);
  font-weight: 800;
  font-size: .9rem;
  line-height: 1;
  color: var(--ink);
  cursor: pointer;
}
.icon-chip svg { display: block; }
.icon-chip:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--shadow); }
.icon-chip { position: relative; }
.icon-chip::after { content: ""; position: absolute; inset: -7px -4px; }

dialog.settings {
  width: min(88vw, 340px);
  padding: 18px 20px 16px;
  background: var(--board);
  color: var(--ink);
  font-family: var(--body);
}
dialog.settings::backdrop { background: rgba(0, 0, 0, .45); }

dialog.langs { max-height: min(86vh, 660px); overflow-y: auto; }
dialog.langs h2 { margin-block: 2px 14px; margin-inline: 0 44px; }
.langs-close {
  position: absolute; top: 10px; inset-inline-end: 10px;
  width: 38px; height: 38px; border: 0; border-radius: 50%;
  background: var(--board-2); color: var(--ink);
  font-size: 1.5rem; line-height: 1; cursor: pointer;
}
.lang-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.lang-pick {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 11px 14px;
  font: inherit; font-weight: 700; text-align: start; color: var(--ink);
  background: var(--board-2); border: 2.5px solid transparent; border-radius: 12px;
  cursor: pointer;
}
.lang-pick[aria-current="true"] { border-color: var(--line); }
.langs-close:focus-visible,
.lang-pick:focus-visible { outline: 3px solid var(--violet); outline-offset: 1px; }
.lang-flag { flex: none; width: 30px; height: 20px; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .18); }
body.start .start-meta { justify-content: center; margin-top: 12px; }

html.i18n-wait body { opacity: 0; animation: i18n-show 0s linear 2.5s forwards; }
@keyframes i18n-show { to { opacity: 1; } }
dialog.settings h2 { margin: 0 0 12px; font-family: var(--display); font-size: 1.15rem; }
dialog.settings .setting { display: flex; align-items: center; gap: 10px; font-weight: 700; cursor: pointer; }
dialog.settings input[type="checkbox"] { width: 22px; height: 22px; margin: 0; accent-color: var(--ok); }
dialog.settings .setting-note { margin: 6px 0 16px; margin-inline-start: 32px; font-size: .86rem; line-height: 1.4; color: var(--ink-soft); }
dialog.settings .setting-home { margin: 0 0 16px; padding-top: 14px; border-top: 1.5px solid var(--board-2); }
dialog.settings .setting-home h3 { margin: 0 0 12px; font-size: .95rem; font-weight: 700; }
dialog.settings .settings-close {
  display: block;
  margin-left: auto;
  padding: 6px 16px;
  font: inherit;
  font-weight: 700;
  color: var(--ink);
  background: var(--board-2);
  border: 2.5px solid var(--line);
  border-radius: 999px;
  box-shadow: 2px 2px 0 var(--shadow);
  cursor: pointer;
}

dialog.how-sheet { width: min(calc(100vw - 28px), 412px); max-width: none; padding: 18px 16px 16px; max-height: min(88vh, 760px); }
dialog.how-sheet h2 { font-size: 1.3rem; }
dialog.how-sheet .how-body > :first-child { margin-top: 0; }
dialog.how-sheet .how-more { margin-top: 14px; font-weight: 700; }
dialog.how-sheet .how-more a { color: var(--ink); }

:root[data-colorblind="on"] body.cards,
:root[data-colorblind="on"] body.cards[data-theme] { --ok: #1D5FB8; }
.cookie-banner,.cookie-dialog{color:#173b29;background:#faf7ef;border:1px solid #24563a;border-radius:20px;padding:22px;text-align:start}
.cookie-banner h2,.cookie-banner a,.cookie-dialog h2,.cookie-dialog h3,.cookie-dialog a{color:inherit}
.cookie-banner{position:fixed;inset:auto 16px 16px;z-index:30;max-width:640px;margin-inline:auto;box-shadow:0 8px 32px #10261933}
.cookie-banner{max-height:calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));overflow-y:auto;overscroll-behavior:contain}
.cookie-banner h2,.cookie-dialog h2{font-size:1.3rem;margin:0 0 12px}
.cookie-banner p,.cookie-dialog p{font-size:.95rem;line-height:1.5;margin:0 0 16px}
.cookie-dialog{max-width:560px;width:calc(100% - 32px);max-height:85dvh;overflow:auto}
.cookie-dialog::backdrop{background:#10261988}
.cookie-dialog h3{font-size:1rem;margin:18px 0 8px}
.cookie-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:18px}
.cookie-button{appearance:none;min-height:44px;padding:10px 16px;border:1px solid #24563a;border-radius:12px;background:#faf7ef;color:#24563a;font:inherit;font-size:.9rem;font-weight:600;cursor:pointer}
.cookie-button:hover{background:#e7efdf}.cookie-button:focus-visible{outline:3px solid #24563a;outline-offset:3px}
.cookie-button.cookie-accept,.cookie-button.cookie-reject{background:#24563a;color:#faf7ef}
.cookie-button.cookie-accept:hover,.cookie-button.cookie-reject:hover{background:#1c4430}
.cookie-toggle{display:flex;gap:12px;align-items:center;font-weight:700;margin-top:16px}.cookie-toggle input{width:22px;height:22px;accent-color:#24563a}
.cookie-footer{text-align:center;padding:0 16px 24px}.cookie-footer .cookie-button{border-color:transparent;text-decoration:underline}
@media(max-width:480px){.cookie-actions .cookie-button{flex:1 1 100%;padding-inline:8px}.cookie-banner{padding:18px}.cookie-banner p{font-size:.875rem}}
