/* Design tokens: docs/DESIGN_SYSTEM.md says what each one is for. Colours,
   radii, spacing and sizes are written only in this block. */
:root,
[data-palette="green"] {
  /* Each colour as light-dark(light, dark): dark when the system asks for it
     and the user has not chosen light, or when the user has chosen dark.
     A palette sets these again (below); the error colours stay in all. */
  --md-primary: light-dark(#006c4c, #6cdbac);
  --md-on-primary: light-dark(#ffffff, #003825);
  --md-primary-container: light-dark(#89f8c7, #005138);
  --md-on-primary-container: light-dark(#002114, #89f8c7);
  --md-secondary-container: light-dark(#cfe9d9, #3b5347);
  --md-on-secondary-container: light-dark(#092016, #cfe9d9);
  --md-tertiary-container: light-dark(#c1e8fb, #244c5b);
  --md-on-tertiary-container: light-dark(#001f29, #c1e8fb);
  --md-surface: light-dark(#fbfdf9, #222624);
  --md-on-surface: light-dark(#191c1a, #d6dad5);
  --md-on-surface-variant: light-dark(#404943, #b4bdb7);
  --md-outline: light-dark(#707973, #8f9891);
  --md-outline-variant: light-dark(#bfc9c2, #4b534e);
  --md-surface-container-low: light-dark(#f5f7f3, #282c2a);
  --md-surface-container: light-dark(#eff1ed, #2c302e);
  --md-surface-container-high: light-dark(#e9ece7, #363a38);
  --md-surface-container-highest: light-dark(#e4e6e2, #414543);
  --md-app-bar: light-dark(#006c4c, #005138);
  --md-on-app-bar: light-dark(#ffffff, #89f8c7);
  --md-app-bar-accent: light-dark(#89f8c7, #ffffff);
}

:root {
  --md-error: light-dark(#ba1a1a, #ffb4ab);
  --md-error-container: light-dark(#ffdad6, #93000a);
  --md-on-error-container: light-dark(#410002, #ffdad6);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;

  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 999px;

  --row-height: 44px;
  --control-height: 40px;
  --tab-height: 48px;
  --rail-width: 88px;
  --flag-width: 21px;
  --flag-height: 14px;
  --column-form: 440px;
  --column-settings: 560px;
  --column-letter: 640px;
  --column-toc: 240px;
  --column-guide: 1600px;
  --display-size: 36px;
  --display-line: 44px;

  --font-sans: Roboto, "Segoe UI", system-ui, sans-serif;
  --font-mono: "Roboto Mono", ui-monospace, Consolas, monospace;

  --md-scrim: color-mix(in srgb, var(--md-on-surface) 32%, transparent);

  /* The players of the played match (play/looks.js, Figure.svelte): skin,
     hair and gear in the same colours in both themes, since they are
     people and not the interface; the ink of a figure's outlines and its
     shadow on the floor. */
  --pm-skin-1: #f3d2b4;
  --pm-skin-2: #e5b48c;
  --pm-skin-3: #c98e62;
  --pm-skin-4: #8d5a3b;
  --pm-skin-5: #5e3b26;
  --pm-hair-black: #26221f;
  --pm-hair-brown: #6b4423;
  --pm-hair-blond: #e0b84e;
  --pm-hair-red: #b5532a;
  --pm-hair-grey: #9a9892;
  --pm-hair-white: #ecebe6;
  --pm-gear-white: #f7f7f5;
  --pm-gear-black: #2c2c2a;
  --pm-gear-yellow: #f2c230;
  --pm-gear-pink: #e2559a;
  --pm-gear-green: #3fb37a;
  --pm-gear-blue: #2f7fe0;
  --pm-gear-red: #d93b3b;
  --pm-gear-orange: #f07f2a;
  --pm-ink: #2c2c2a;
  --pm-shadow: color-mix(in srgb, #000000 14%, transparent);
  /* The rink of the played match (play/PlayRink.svelte): a sports hall's
     blue court, grey when a kit is too close to the blue, white lines and
     boards, red goal cages with white nets, the same in both themes as a
     real floor; only the hall around the boards follows the theme. */
  --pm-floor-blue: #2f6496;
  --pm-floor-grey: #868e93;
  --pm-floor-light: #ffffff;
  --pm-line: #ffffff;
  --pm-board: #f4f4f1;
  --pm-goal: #d93b3b;
  --pm-net: #ffffff;
  --pm-hall: light-dark(#b8bcb7, #161918);

  /* The shirt number on a club's colour in the replay rink, whichever of
     the two reads better on it (rinkColours in replayrink.go). */
  --shirt-ink-dark: #000000;
  --shirt-ink-light: #ffffff;

  color-scheme: light dark;
}

/* The other palettes a manager can pick (palette.go), each made from one
   source colour like the green: sapphire #0f52ba, amber #ffbf00. */
[data-palette="sapphire"] {
  --md-primary: light-dark(#375ca9, #b0c6ff);
  --md-on-primary: light-dark(#ffffff, #002c6f);
  --md-primary-container: light-dark(#d9e2ff, #1a438f);
  --md-on-primary-container: light-dark(#001945, #d9e2ff);
  --md-secondary-container: light-dark(#dce2f9, #474d60);
  --md-on-secondary-container: light-dark(#151b2c, #dce2f9);
  --md-tertiary-container: light-dark(#fdd7fa, #593d59);
  --md-on-tertiary-container: light-dark(#2a122c, #fdd7fa);
  --md-surface: light-dark(#fefbff, #242528);
  --md-on-surface: light-dark(#1b1b1f, #dad8dc);
  --md-on-surface-variant: light-dark(#44464f, #babbc5);
  --md-outline: light-dark(#757780, #94959f);
  --md-outline-variant: light-dark(#c5c6d0, #4f5159);
  --md-surface-container-low: light-dark(#f8f6fa, #2a2b2e);
  --md-surface-container: light-dark(#f2f0f4, #2f2f32);
  --md-surface-container-high: light-dark(#eceaee, #39393c);
  --md-surface-container-highest: light-dark(#e6e4e9, #444448);
  --md-app-bar: light-dark(#375ca9, #1a438f);
  --md-on-app-bar: light-dark(#ffffff, #d9e2ff);
  --md-app-bar-accent: light-dark(#d9e2ff, #ffffff);
}
[data-palette="amber"] {
  --md-primary: light-dark(#795900, #f3bf48);
  --md-on-primary: light-dark(#ffffff, #402d00);
  --md-primary-container: light-dark(#ffdfa0, #5c4300);
  --md-on-primary-container: light-dark(#261a00, #ffdfa0);
  --md-secondary-container: light-dark(#f5e0bb, #5a4c30);
  --md-on-secondary-container: light-dark(#241a04, #f5e0bb);
  --md-tertiary-container: light-dark(#ccebc4, #334d30);
  --md-on-tertiary-container: light-dark(#082008, #ccebc4);
  --md-surface: light-dark(#fffbff, #28241f);
  --md-on-surface: light-dark(#1e1b16, #dfd7cf);
  --md-on-surface-variant: light-dark(#4d4639, #c5baa9);
  --md-outline: light-dark(#7f7667, #9f9585);
  --md-outline-variant: light-dark(#d0c5b4, #585043);
  --md-surface-container-low: light-dark(#fdf5ec, #2e2b25);
  --md-surface-container: light-dark(#f8efe7, #322f29);
  --md-surface-container-high: light-dark(#f2eae1, #3d3933);
  --md-surface-container-highest: light-dark(#ece4db, #48443e);
  --md-app-bar: light-dark(#795900, #5c4300);
  --md-on-app-bar: light-dark(#ffffff, #ffdfa0);
  --md-app-bar-accent: light-dark(#ffdfa0, #ffffff);
}

:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

/* Roboto, served by the game itself (static/fonts/LICENSE.txt). */
@font-face {
  font-family: Roboto; font-style: normal; font-weight: 400; font-display: swap;
  src: url(fonts/roboto-latin-400-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: Roboto; font-style: normal; font-weight: 400; font-display: swap;
  src: url(fonts/roboto-latin-ext-400-normal.woff2) format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: Roboto; font-style: normal; font-weight: 500; font-display: swap;
  src: url(fonts/roboto-latin-500-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: Roboto; font-style: normal; font-weight: 500; font-display: swap;
  src: url(fonts/roboto-latin-ext-500-normal.woff2) format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: Roboto; font-style: normal; font-weight: 700; font-display: swap;
  src: url(fonts/roboto-latin-700-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: Roboto; font-style: normal; font-weight: 700; font-display: swap;
  src: url(fonts/roboto-latin-ext-700-normal.woff2) format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  display: flex; flex-direction: column; min-height: 100vh;
  background: var(--md-surface);
  color: var(--md-on-surface);
  font: 400 14px/20px var(--font-sans);
  font-variant-numeric: tabular-nums;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--md-primary); }
main :where(a:not(.btn, .side, .card-title)) { color: var(--md-primary); }
main a.muted { color: var(--md-primary); }
:focus-visible { outline: 2px solid var(--md-primary); outline-offset: 2px; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: var(--space-6) var(--space-6) calc(var(--space-6) * 2); }

h1 { font: 400 28px/36px var(--font-sans); margin: 0 0 var(--space-3); }
h2 { font: 400 22px/28px var(--font-sans); margin: var(--space-6) 0 var(--space-3); }
h3 { font: 500 16px/24px var(--font-sans); margin: var(--space-4) 0 var(--space-2); }
h1 small, h3 small { font-weight: 400; font-size: 0.8em; }
small { font-size: 12px; line-height: 16px; }
.muted { color: var(--md-on-surface-variant); }
.center { text-align: center; }
p { margin: 0 0 var(--space-3); }

/* Icons: outline, in the colour of the text around them. */
.icon {
  flex: none; width: 24px; height: 24px; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.icon.trophy { width: 20px; height: 20px; color: var(--md-primary); vertical-align: middle; }
/* Info mark: an 18px info icon after a short text, whose tooltip says the
   rest. */
.info-mark { display: inline-flex; vertical-align: middle; margin-left: var(--space-1); color: var(--md-on-surface-variant); cursor: help; border-radius: var(--radius-full); }
.info-mark .icon { width: 18px; height: 18px; }
.info-mark:focus-visible { outline: 2px solid var(--md-primary); outline-offset: 2px; }

/* Top app bar */
header.top {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4);
  min-height: 64px; padding: var(--space-2) var(--space-6); background: var(--md-app-bar); color: var(--md-on-app-bar);
}
.brand { display: grid; line-height: 1; }
.brand-mark { font-size: 25px; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; }
.brand-mark span { color: var(--md-app-bar-accent); }
.brand-name {
  margin-top: calc(var(--space-1) / 2); font-size: 10px; font-weight: 500;
  letter-spacing: 0.32em; text-transform: uppercase; opacity: 0.8;
}
/* On the bar everything takes its text colour; a link is underlined on hover. */
header.top a:hover, header.top .btn, header.top .btn:hover { color: inherit; }
header.top a:not(.brand, .world-name):hover { text-decoration: underline; }
header.top .btn:hover, header.top .world-name:hover { background: color-mix(in srgb, var(--md-on-app-bar) 12%, transparent); }
header.top :focus-visible { outline-color: var(--md-on-app-bar); }
/* The world chip and its pen wrap as one, so the pen never starts a line of its own. */
.world-group { display: inline-flex; align-items: center; gap: var(--space-2); }
.world-name {
  display: inline-flex; align-items: center; height: 32px; padding: 0 var(--space-4);
  border: 1px solid currentColor; border-radius: var(--radius-sm); font-weight: 500;
}
/* The Club / Nation switch of a manager who holds a national team: a chip of two links, the current one tinted. */
.team-switch {
  display: inline-flex; height: 32px; border: 1px solid currentColor; border-radius: var(--radius-sm); overflow: hidden;
}
.team-switch a { display: inline-flex; align-items: center; gap: var(--space-2); padding: 0 var(--space-3); font-weight: 500; }
.team-switch a + a { border-left: 1px solid currentColor; }
header.top .team-switch a:hover { text-decoration: none; background: color-mix(in srgb, var(--md-on-app-bar) 12%, transparent); }
header.top .team-switch a.on { background: color-mix(in srgb, var(--md-on-app-bar) 24%, transparent); }
.theme { margin-left: auto; gap: var(--space-2); }
.theme::before {
  content: ""; width: 20px; height: 20px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 3v2M12 19v2M3 12h2M19 12h2M5.6 5.6l1.4 1.4M17 17l1.4 1.4M18.4 5.6L17 7M7 17l-1.4 1.4'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 3v2M12 19v2M3 12h2M19 12h2M5.6 5.6l1.4 1.4M17 17l1.4 1.4M18.4 5.6L17 7M7 17l-1.4 1.4'/%3E%3C/svg%3E") center / contain no-repeat;
}
.language { display: flex; align-items: center; gap: var(--space-2); margin: 0; }
.language label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
header.top .language select {
  height: 32px; padding: 0 var(--space-2); border: 1px solid currentColor; border-radius: var(--radius-sm);
  background: transparent; color: inherit; font: inherit;
}
header.top .language option { color: var(--md-on-surface); background: var(--md-surface); }
.user { display: flex; align-items: center; gap: var(--space-4); margin: 0; }
.user a { font-weight: 500; }
.user .nick { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The report button and the pen of an offline world: the icon alone, in a round 40px button. */
header.top .report-link, header.top .custom-link, header.top .changelog-link { width: var(--control-height); padding: 0; }
/* The changelog button: a dot while an entry the account has not seen is published. */
header.top .changelog-link { position: relative; }
header.top .changelog-link[aria-current] { background: color-mix(in srgb, var(--md-on-app-bar) 12%, transparent); }
header.top .changelog-link .dot {
  position: absolute; top: var(--space-1); right: var(--space-1); width: 10px; height: 10px;
  border: 2px solid var(--md-app-bar); border-radius: var(--radius-full); background: var(--md-error);
}
/* The pen of an offline world is tinted on its own page, as the bar's buttons are on hover. */
header.top .custom-link[aria-current] { background: color-mix(in srgb, var(--md-on-app-bar) 12%, transparent); }
/* The number of new reports beside Administration. */
header.top .badge {
  display: inline-block; min-width: 16px; height: 16px; padding: 0 var(--space-1); margin-left: var(--space-1);
  border-radius: var(--radius-sm); background: var(--md-error); color: var(--md-surface);
  font: 500 11px/16px var(--font-sans); text-align: center; vertical-align: 1px;
}

/* The advance bar under the top bar of a world played by hand. */
.advance-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4);
  padding: var(--space-2) var(--space-6); background: var(--md-surface-container-high);
}
.advance-bar > span { flex-grow: 1; }
.advance-bar form { display: flex; gap: var(--space-2); margin: 0; }

/* Navigation rail beside the page, on a tinted column as tall as the page;
   across the top on a narrow screen. */
.frame { flex: 1; display: flex; align-items: flex-start; position: relative; }
.frame::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: var(--rail-width);
  background: var(--md-surface-container);
}
.frame > main.wrap { flex: 1 1 0; min-width: 0; max-width: none; margin: 0; }
.rail {
  flex: none; width: var(--rail-width); display: flex; flex-direction: column; align-items: center;
  gap: var(--space-1); padding: var(--space-3) var(--space-1); position: sticky; top: 0;
  z-index: 1;
}
.rail a {
  width: 80px; display: flex; flex-direction: column; align-items: center; gap: var(--space-1);
  padding: var(--space-1) 0; font: 500 12px/16px var(--font-sans); color: var(--md-on-surface-variant);
  text-align: center;
}
.rail .pill {
  position: relative; width: 56px; height: 32px; border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
}
.rail a:hover { color: var(--md-on-surface); }
.rail a:hover .pill { background: var(--md-surface-container-highest); }
.rail a.on { color: var(--md-on-surface); font-weight: 700; }
.rail a.on .pill { background: var(--md-secondary-container); color: var(--md-on-secondary-container); }
.rail .badge {
  position: absolute; top: 0; right: var(--space-1); min-width: 16px; height: 16px; padding: 0 var(--space-1);
  border-radius: var(--radius-sm); background: var(--md-error); color: var(--md-surface);
  font: 500 11px/16px var(--font-sans); text-align: center;
}
.rail .dot {
  position: absolute; top: var(--space-1); right: var(--space-3); width: 10px; height: 10px;
  border: 2px solid var(--md-surface-container); border-radius: var(--radius-full);
  background: var(--md-error);
}
@media (max-width: 700px) {
  .frame { display: block; }
  .frame::before { content: none; }
  .rail {
    width: auto; flex-direction: row; flex-wrap: wrap; justify-content: center; position: static;
    padding: var(--space-2) var(--space-1); background: var(--md-surface-container);
  }
  header.top, .advance-bar { padding-left: var(--space-4); padding-right: var(--space-4); }
  .wrap { padding: var(--space-4) var(--space-4) calc(var(--space-6) * 2); }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; height: var(--control-height);
  padding: 0 var(--space-6); border: 1px solid var(--md-outline); border-radius: var(--radius-full);
  background: transparent; color: var(--md-primary); font: 500 14px/20px var(--font-sans);
  white-space: nowrap; cursor: pointer;
}
.btn:hover { background: color-mix(in srgb, var(--md-primary) 8%, transparent); color: var(--md-primary); }
.btn.primary { border-color: transparent; background: var(--md-primary); color: var(--md-on-primary); }
.btn.primary:hover { background: color-mix(in srgb, var(--md-primary) 90%, var(--md-on-primary)); color: var(--md-on-primary); }
.btn.tonal, .btn.on { border-color: transparent; background: var(--md-secondary-container); color: var(--md-on-secondary-container); }
.btn.tonal:hover { background: color-mix(in srgb, var(--md-secondary-container) 90%, var(--md-on-secondary-container)); color: var(--md-on-secondary-container); }
.btn.text { border-color: transparent; padding: 0 var(--space-3); }
.btn.danger { color: var(--md-error); }
.btn.danger:hover { background: color-mix(in srgb, var(--md-error) 8%, transparent); color: var(--md-error); }
.btn[disabled], .btn[disabled]:hover { background: transparent; color: var(--md-on-surface); opacity: 0.38; cursor: default; }
.btn-row { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.data .btn { padding: 0 var(--space-4); }

/* Fields */
label { font-weight: 500; }
input, select, textarea {
  font: 400 14px/20px var(--font-sans); border: 1px solid var(--md-outline); border-radius: var(--radius-xs);
  background: var(--md-surface); color: var(--md-on-surface); max-width: 100%; min-width: 0;
}
select, input:not([type="checkbox"], [type="radio"], [type="color"], [type="file"]) {
  height: var(--tab-height); padding: 0 var(--space-3);
}
input:not([type="checkbox"], [type="radio"], [type="color"], [type="file"]) { flex: 1 1 180px; }
textarea { padding: var(--space-3); width: 100%; resize: vertical; }
.data select, .place select, .picker select, .week select,
.data input:not([type="checkbox"], [type="radio"]), form.inline input, .kept-row input {
  height: var(--control-height);
}
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: -1px; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--md-primary); width: 18px; height: 18px; }
.fields > select, .fields > input { max-width: 360px; }
select.unset { border-color: var(--md-outline-variant); color: var(--md-on-surface-variant); }
select.unset option { color: var(--md-on-surface); }

/* Banners */
.error, .saved {
  display: flex; align-items: flex-start; gap: var(--space-3); margin: 0 0 var(--space-4);
  padding: var(--space-3) var(--space-4); border-radius: var(--radius-md);
}
.error::before, .saved::before { content: ""; flex: none; width: 20px; height: 20px; background: currentColor; }
.saved { background: var(--md-primary-container); color: var(--md-on-primary-container); }
.saved::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.error { background: var(--md-error-container); color: var(--md-on-error-container); }
.error[hidden], .saved[hidden] { display: none; }
.error::before {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4l9 16H3l9-16zM12 10v4M12 17v.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4l9 16H3l9-16zM12 10v4M12 17v.5'/%3E%3C/svg%3E") center / contain no-repeat;
}

form.autosaving [data-save] { display: none; }

/* Badges and flags */
.pos {
  display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px;
  border-radius: var(--radius-sm); font: 500 12px/16px var(--font-sans); vertical-align: middle;
  background: var(--md-surface-container-highest); color: var(--md-on-surface);
}
.pos-D { background: var(--md-secondary-container); color: var(--md-on-secondary-container); }
.pos-C { background: var(--md-primary-container); color: var(--md-on-primary-container); }
.pos-W { background: var(--md-tertiary-container); color: var(--md-on-tertiary-container); }
tr.shown .pos-D, .mine .pos-D { background: var(--md-surface); color: var(--md-on-surface); }
.status {
  display: inline-flex; align-items: center; height: 22px; padding: 0 var(--space-2); margin-left: var(--space-1);
  border: 1px solid transparent; border-radius: var(--radius-sm); font: 500 11px/16px var(--font-sans);
  white-space: nowrap; vertical-align: middle;
  background: var(--md-error-container); color: var(--md-on-error-container);
}
.status[hidden] { display: none; }
.status.info { background: var(--md-tertiary-container); color: var(--md-on-tertiary-container); }
.status.good { background: var(--md-primary-container); color: var(--md-on-primary-container); }
.status.captain { background: var(--md-primary); color: var(--md-on-primary); }
.status.quiet { background: transparent; border-color: var(--md-outline); color: var(--md-on-surface-variant); }
.status.national { gap: var(--space-1); background: transparent; border-color: var(--md-outline); color: var(--md-on-surface); }
.status.national.away { background: var(--md-surface-container-highest); border-color: transparent; color: var(--md-on-surface-variant); }
.nat { font: 500 11px/14px var(--font-sans); color: var(--md-on-surface-variant); }
.flag {
  display: inline-block; width: var(--flag-width); height: var(--flag-height); object-fit: cover;
  border-radius: calc(var(--radius-xs) / 2); box-shadow: 0 0 0 1px var(--md-outline-variant); vertical-align: -2px;
}
.honours { list-style: none; padding: var(--space-2) 0; margin: 0 0 var(--space-4); }
.honours li { display: flex; align-items: center; gap: var(--space-4); min-height: var(--control-height); padding: var(--space-1) var(--space-4); }

/* Cards and layout */
.card { background: var(--md-surface); border: 1px solid var(--md-outline-variant); border-radius: var(--radius-md); padding: var(--space-4); }
.card > h2, .card > h3, .card > form > h2 { font: 500 16px/24px var(--font-sans); margin: 0 0 var(--space-3); }
.cards { list-style: none; padding: 0; margin: 0 0 var(--space-4); display: grid; gap: var(--space-3); }
.card-title { display: flex; align-items: center; gap: var(--space-2); font: 500 16px/24px var(--font-sans); color: var(--md-on-surface); }
.grid { display: grid; gap: var(--space-6) var(--space-4); }
/* Two grids one under another stand 24px apart, as the rows of a grid do;
   a .stack sets its own gap and clears this below. */
:where(.grid) + :where(.grid) { margin-top: var(--space-6); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.grid.two > section > h2:first-child { margin-top: 0; }
/* A stack: the blocks of a page under its tabs, one under another. */
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-6); }
.stack > * { margin: 0; }
.stack .card > h3 { margin-top: var(--space-4); }
.stack .card > h3:first-child { margin-top: 0; }
.stack .card > .divider { margin: var(--space-4) 0; }
.stack .card > small { display: block; margin-top: var(--space-2); }
.stack .card > form + form { margin-top: var(--space-2); }
.stack > section > h2:first-child { margin-top: 0; }
/* Head-to-head: its heading, the three tiles, the goals and the latest
   matches, 12px apart. */
.h2h { display: grid; gap: var(--space-3); }
.h2h > * { margin: 0; }
@media (min-width: 820px) {
  .grid.two.wide-left { grid-template-columns: 5fr 6fr; }
}
.grid.four { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-4); }
.advance, .notice {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--space-3) var(--space-4); margin-bottom: var(--space-4);
}
.advance h2 { margin: 0 0 calc(var(--space-1) / 2); }
.advance p { margin: 0; }
.advance form { margin: 0; }
h2.with-flag { display: flex; align-items: center; gap: var(--space-3); }

/* Worlds */
.world-card { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-6); }
.world-card > div:first-child { display: grid; gap: var(--space-2); }
.world-card h2 { font: 400 22px/28px var(--font-sans); margin: 0; }
.world-card p { margin: 0; }
.world-info { display: grid; gap: var(--space-2); padding: var(--space-3) var(--space-4); justify-items: start; }
.world-actions { display: grid; gap: var(--space-4); margin-top: auto; justify-items: start; }
.world-actions form { margin: 0; }
.world-actions .divider { justify-self: stretch; }
.with-pack { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3); justify-self: stretch; }
.with-pack label { flex: 1 1 240px; display: grid; gap: var(--space-2); }
.with-pack input { font-weight: 400; color: var(--md-on-surface-variant); }

/* World overview */
.mine-panel {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-4) var(--space-6);
  padding: var(--space-4) calc(var(--space-4) + var(--space-1)); margin-bottom: var(--space-4);
}
.mine-panel > div { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-1); }
.mine-panel h3 { margin: 0; font: 500 12px/16px var(--font-sans); color: var(--md-on-surface-variant); }
.mine-panel .club, .mine-panel .big { font: 500 16px/24px var(--font-sans); }
.mine-panel .big b { font-weight: 700; }
.mine-panel .status { height: 24px; margin-left: 0; font-size: 14px; }

/* Tabs */
.tabs {
  display: flex; overflow-x: auto; border-bottom: 1px solid var(--md-outline-variant);
  margin-bottom: var(--space-4); scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  position: relative; flex: none; display: flex; align-items: center; height: var(--tab-height);
  padding: 0 calc(var(--space-4) + var(--space-1)); font-weight: 500; color: var(--md-on-surface-variant); white-space: nowrap;
}
.tabs a:hover { color: var(--md-on-surface); }
.tabs a.on { color: var(--md-primary); }
.tabs a.on::after {
  content: ""; position: absolute; left: var(--space-4); right: var(--space-4); bottom: 0; height: 3px;
  border-radius: var(--radius-xs) var(--radius-xs) 0 0; background: var(--md-primary);
}

/* Clubs */
.club { display: inline-flex; align-items: center; gap: var(--space-2); min-width: 0; color: var(--md-primary); font-weight: 500; }
.crest { flex: none; }
.crest.sm { width: 18px; height: 21px; }
.crest.sm text { display: none; }
.crest.lg { width: 63px; height: 72px; }
.hero { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4) calc(var(--space-4) + var(--space-1)); margin-bottom: var(--space-4); }
.hero > div:not(.stat, .hero-actions) { flex: 1 1 320px; min-width: 0; display: grid; gap: var(--space-1); }
.hero h1 { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin: 0; }
.hero p { margin: 0; }
.hero .manager b { font-weight: 500; color: var(--md-on-surface); }
.hero-actions { display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-2); }
.shirt {
  flex: none; width: 72px; height: 72px; border-radius: var(--radius-full); display: flex; align-items: center;
  justify-content: center; background: var(--md-primary-container); color: var(--md-on-primary-container);
  font: 500 28px/36px var(--font-sans);
}
.shirt.sm { width: 48px; height: 48px; font: 500 16px/24px var(--font-sans); }
.stars { display: inline-flex; gap: calc(var(--space-1) / 2); color: var(--md-primary); }
.stars svg { width: 18px; height: 18px; fill: currentColor; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
.stars svg.off { fill: none; }
.hero .stars svg { width: 24px; height: 24px; }

/* Tinted panels, stat tiles and dividers */
.panel { padding: var(--space-4); border-radius: var(--radius-md); background: var(--md-surface-container-low); }
.stat {
  display: flex; flex-direction: column; gap: calc(var(--space-1) / 2); padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm); background: var(--md-surface-container-highest);
}
.stat span { font: 500 11px/16px var(--font-sans); color: var(--md-on-surface-variant); }
.stat b { font: 400 22px/28px var(--font-sans); }
.stat.big { align-items: flex-end; padding: var(--space-2) var(--space-4); border-radius: var(--radius-md); }
.stat.big b { font: 400 32px/40px var(--font-sans); }
.divider { width: 100%; height: 1px; margin: 0; border: 0; background: var(--md-outline-variant); }
.card > .bars + .divider { margin: var(--space-4) 0; }

/* Data tables */
.scroll { overflow-x: auto; background: var(--md-surface); border: 1px solid var(--md-outline-variant); border-radius: var(--radius-md); }
table.data { border-collapse: collapse; width: 100%; }
.data th, .data td {
  height: var(--row-height); padding: 0 var(--space-2); text-align: left; white-space: nowrap;
  border-bottom: 1px solid var(--md-outline-variant);
}
.data th { background: var(--md-surface-container-low); font: 500 12px/16px var(--font-sans); color: var(--md-on-surface-variant); }
.data th:first-child, .data td:first-child { padding-left: var(--space-4); }
.data th:last-child, .data td:last-child { padding-right: var(--space-4); }
.data tbody tr:last-child td { border-bottom: 0; }
.data tfoot td { border-top: 1px solid var(--md-outline-variant); border-bottom: 0; font-weight: 500; background: var(--md-surface-container-low); }
.data th[data-sort] { cursor: pointer; user-select: none; }
.data th[data-sort]:hover, .data th[data-dir] { color: var(--md-on-surface); }
.data th[data-dir="asc"]::before { content: "↑ "; }
.data th[data-dir="desc"]::before { content: "↓ "; }
.data .n { text-align: right; }
/* A report in the admin's list opens to its text, kept as written. */
.data .report-text { max-width: 60ch; margin: var(--space-2) 0; white-space: pre-wrap; }
.data .strong { font-weight: 700; }
.data .center { text-align: center; }
.data th.fit { width: 1%; }
table.data.fixed { table-layout: fixed; }
.data.fixed td { white-space: normal; }
.data td:has(> a + .status, > .player-mark + .status) { white-space: normal; }
.data a { font-weight: 500; }
.data .club { vertical-align: middle; }
/* The club column of a standings table takes the room the numbers leave
   and cuts a long name short, so that two cup groups fit side by side. The
   name asks for no width of its own, so the cell never gets narrower than
   14ch and a narrow screen scrolls the table instead of overlapping it. */
.standings .club-cell { width: 100%; }
.standings .club-cell .club { display: flex; min-width: 14ch; }
.standings .club-cell .club span { flex: 1; width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.club-cups { display: flex; align-items: center; gap: var(--space-2); }
.club-cups .club { flex: 1; }
.data tbody tr:hover td { background: var(--md-surface-container-low); }
.data tbody tr.shown td { background: var(--md-secondary-container); color: var(--md-on-secondary-container); }
.data tbody tr.mine td { background: var(--md-secondary-container); color: var(--md-on-secondary-container); }
.hi {
  display: inline-block; min-width: 28px; padding: calc(var(--space-1) / 2) 0; border-radius: var(--radius-sm);
  background: var(--md-primary-container); color: var(--md-on-primary-container); font-weight: 700; text-align: center;
}
.lo { color: var(--md-on-surface-variant); }
.delta { display: block; font: 500 11px/12px var(--font-sans); color: var(--md-on-surface-variant); }
.delta.up { color: var(--md-primary); }
.gain { color: var(--md-primary); }
.loss, .stat.loss b { color: var(--md-error); }
.data tr.line-start td { border-top: 2px solid var(--md-outline-variant); }
.data .answer .status { margin: 0 var(--space-1) 0 0; }
.legend { display: flex; align-items: center; gap: var(--space-2); margin: var(--space-3) 0 0; color: var(--md-on-surface-variant); }
.cup-mark { flex: none; width: 28px; height: 20px; border-radius: var(--radius-sm); background: var(--md-primary-container); }
.hi.alt, .cup-mark.alt { background: var(--md-tertiary-container); color: var(--md-on-tertiary-container); }
.hi.down, .cup-mark.down { background: var(--md-error-container); color: var(--md-on-error-container); }
/* A cup open to the whole world that a club goes on to, beside its name. */
.cup-chip {
  display: inline-flex; flex: none; align-items: center; height: 20px; padding: 0 var(--space-1);
  border: 1px solid var(--md-outline); border-radius: var(--radius-sm); font: 500 11px/16px var(--font-sans);
  color: var(--md-on-surface-variant); text-decoration: none; vertical-align: middle; white-space: nowrap;
}
.legend .cup-chip { min-width: 28px; justify-content: center; }
.legend.note { font-style: italic; }
.data tr.zone-start td { border-top: 2px solid var(--md-outline-variant); }
/* A club's form: its last results, oldest first. */
.form { display: inline-flex; gap: var(--space-1); vertical-align: middle; }
.mark {
  display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 22px; padding: 0 var(--space-1);
  border: 1px solid transparent; border-radius: var(--radius-sm); font: 500 11px/16px var(--font-sans);
}
.mark-win { background: var(--md-primary); color: var(--md-on-primary); }
.mark-extra_win { background: var(--md-primary-container); color: var(--md-on-primary-container); }
.mark-extra_loss { border-color: var(--md-outline); color: var(--md-on-surface-variant); }
.mark-loss { background: var(--md-error-container); color: var(--md-on-error-container); }
td input[type="checkbox"] { flex: none; min-width: 0; }

.mini-table { list-style: none; padding: 0; margin: var(--space-2) 0 0; }
.mini-table li { display: flex; align-items: center; gap: var(--space-2); min-height: 36px; }
.mini-table .rank { flex: none; width: 16px; color: var(--md-on-surface-variant); }
.mini-table .club { flex: 1 1 auto; }
.mini-table .club span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Meters */
.meter, .track {
  height: 4px; border-radius: calc(var(--radius-xs) / 2); background: var(--md-surface-container-highest); overflow: hidden;
}
.meter { display: inline-block; width: 48px; vertical-align: middle; }
.track { flex: 1; }
.fill { display: block; height: 100%; border-radius: inherit; background: var(--md-primary); }
.fill.low { background: var(--md-error); }
.meter-value { display: inline-block; width: 24px; text-align: right; }
.bars { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-2) var(--space-3); margin: 0; align-items: center; }
.bars dt { color: var(--md-on-surface-variant); }
.bars dd { margin: 0; display: flex; align-items: center; gap: var(--space-3); }
.bars b { min-width: 28px; font-weight: 400; text-align: center; }
.bars b.hi { font-weight: 700; }
.player-card .bars { font-size: 12px; line-height: 16px; }

/* Fixture lists */
.fixtures {
  list-style: none; padding: 0; margin: 0; border: 1px solid var(--md-outline-variant);
  border-radius: var(--radius-md); overflow: hidden;
}
.fixtures li {
  display: grid; grid-template-columns: minmax(0, 1fr) 72px minmax(0, 1fr); column-gap: var(--space-2);
  align-items: center; min-height: var(--row-height); padding: 0 var(--space-4);
  border-bottom: 1px solid var(--md-outline-variant);
}
.fixtures li:has(.when) { grid-template-columns: 80px minmax(0, 1fr) 72px minmax(0, 1fr); }
.fixtures li:last-child { border-bottom: 0; }
.fixtures li.mine { background: var(--md-secondary-container); }
.fixtures .when { color: var(--md-on-surface-variant); }
.fixtures .home, .fixtures .away { min-width: 0; }
.fixtures .club { display: flex; }
.fixtures .home .club { flex-direction: row-reverse; }
.fixtures .club span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score {
  display: flex; align-items: baseline; justify-content: center; gap: var(--space-1);
  font-weight: 700; color: var(--md-primary);
}
.score.pending { color: var(--md-on-surface-variant); font-weight: 400; }
.score small { font-size: 11px; font-weight: 500; }
/* A friendly says so under its score. */
.fixtures li.friendly .score { flex-wrap: wrap; row-gap: 0; }
.score small.kind { flex-basis: 100%; text-align: center; font-weight: 400; color: var(--md-on-surface-variant); }

/* Note lists: news and the inbox */
.notes { list-style: none; padding: 0; margin: 0; max-width: 920px; }
.notes li {
  display: flex; gap: var(--space-4); min-height: var(--row-height); padding: var(--space-3) 0;
  border-bottom: 1px solid var(--md-outline-variant);
}
.notes li:last-child { border-bottom: 0; }
.notes .when { flex: none; width: 80px; font-weight: 400; color: var(--md-on-surface-variant); }
.notes.boxed { border: 1px solid var(--md-outline-variant); border-radius: var(--radius-md); overflow: hidden; }
.notes.boxed li { gap: var(--space-3); min-height: var(--tab-height); padding: var(--space-3) var(--space-4); }
.notes.boxed li::before {
  content: ""; flex: none; width: 8px; height: 8px; margin-top: calc(var(--space-1) * 1.5);
  border-radius: var(--radius-full);
}
.notes li.unread { background: var(--md-surface-container-low); font-weight: 700; }
.notes li.unread::before { background: var(--md-primary); }
/* An invitation in the inbox is answered on the spot. */
.notes .note-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-2) 0 0; font-weight: 400; }
.notes .note-body {
  margin: var(--space-1) 0 0; font-weight: 400; color: var(--md-on-surface-variant);
  white-space: pre-wrap; overflow-wrap: anywhere;
}

/* Day list: the calendar of a season, every day a row. */
.calendar { list-style: none; padding: 0; margin: 0; max-width: 920px; }
.calendar > li {
  display: flex; gap: var(--space-4); min-height: var(--row-height); padding: var(--space-3);
  border-bottom: 1px solid var(--md-outline-variant); scroll-margin-top: var(--space-6);
}
.calendar > li:last-child { border-bottom: 0; }
.calendar .when { flex: none; width: 96px; display: grid; align-content: start; color: var(--md-on-surface-variant); }
.calendar .what { flex: 1 1 auto; min-width: 0; display: grid; gap: var(--space-2); align-content: start; }
.calendar .what p { margin: 0; }
.calendar .line, .calendar .note { color: var(--md-on-surface-variant); }
.calendar .note.pending { font-style: italic; }
.calendar li.today { background: var(--md-surface-container-low); }
.calendar li.today .when { font-weight: 700; color: var(--md-primary); }
.calendar-earlier { max-width: 920px; border-bottom: 1px solid var(--md-outline-variant); }
.calendar-earlier summary {
  display: flex; align-items: center; gap: var(--space-2); min-height: var(--row-height); padding: 0 var(--space-3);
  font-weight: 500; color: var(--md-primary); cursor: pointer; list-style: none;
}
.calendar-earlier summary::-webkit-details-marker { display: none; }
.calendar-earlier[open] summary { border-bottom: 1px solid var(--md-outline-variant); }
.calendar-earlier[open] summary::after { transform: rotate(180deg); }
@media (max-width: 560px) {
  .calendar > li { flex-direction: column; gap: var(--space-2); }
  .calendar .when { width: auto; display: flex; gap: var(--space-2); }
}

/* Match: the scoreboard, then the play-by-play beside the statistics. */
.scoreboard {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center;
  gap: var(--space-4) var(--space-6); padding: var(--space-6); margin-bottom: var(--space-6);
  border-radius: var(--radius-md); background: var(--md-surface-container-low);
}
.scoreboard .side {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-2);
  font: 500 16px/24px var(--font-sans); text-align: center; color: var(--md-on-surface);
}
.scoreboard .result { display: flex; flex-direction: column; align-items: center; gap: var(--space-1); text-align: center; }
.big-score { font: 400 57px/64px var(--font-sans); }
.replay-start { gap: var(--space-2); margin-top: var(--space-2); padding-left: var(--space-4); }
.replay-start .icon { width: 18px; height: 18px; fill: currentColor; }
.head-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); min-height: calc(var(--control-height) + 2px); margin-bottom: var(--space-3); }
.head-row h2 { flex: 1 0 auto; margin: 0; }
.segmented.short span { min-width: 56px; padding: 0 var(--space-3); }

/* Three stars: the best rated players of a match, three tiles in a row
   under the scoreboard, one under another on a phone. */
.three-stars {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2);
  list-style: none; padding: 0; margin: 0 0 var(--space-6);
}
.three-stars li {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-2) var(--space-4); border-radius: var(--radius-md); background: var(--md-surface-container-low);
}
.three-stars .who { display: flex; flex-direction: column; gap: calc(var(--space-1) / 2); min-width: 0; }
.three-stars .rank {
  display: inline-flex; align-items: center; gap: var(--space-1);
  font: 500 12px/16px var(--font-sans); color: var(--md-on-surface-variant);
}
.three-stars .rank svg { width: 16px; height: 16px; fill: var(--md-primary); }
.three-stars .name { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.three-stars .name a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.three-stars b { font: 400 22px/28px var(--font-sans); }
@media (max-width: 560px) {
  .three-stars { grid-template-columns: 1fr; }
}

/* Player marks: a star player and a talent, small filled icons after the
   name; labelled, the name follows in words. */
.player-mark { display: inline-flex; align-items: center; gap: var(--space-1); vertical-align: middle; margin-left: var(--space-1); }
.player-mark svg { width: 16px; height: 16px; flex: none; }
.player-mark.star svg { fill: var(--md-primary); }
.player-mark.talent svg { fill: var(--md-tertiary-container); stroke: var(--md-on-tertiary-container); stroke-width: 1.5; stroke-linejoin: round; }
.player-mark > span { font-weight: 500; color: var(--md-on-surface); }
.meta .player-mark { margin-left: 0; }
td > .player-mark + .pos, td > a + .pos { margin-left: var(--space-1); }
.marks-legend {
  display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6);
  list-style: none; padding: 0; color: var(--md-on-surface-variant);
}
.marks-legend li { display: flex; align-items: center; gap: var(--space-2); }
.marks-legend .player-mark { margin-left: 0; flex: none; white-space: nowrap; }

/* Team statistics: the home side's numbers at the left, the away side's at
   the right, what they count between them. */
.data.versus { table-layout: fixed; }
.data.versus thead th:last-child, .data.versus td:last-child { text-align: right; }
.data.versus td:first-child { text-align: left; }
.data.versus tbody th { background: none; font: inherit; color: var(--md-on-surface-variant); text-align: center; }
.data.versus thead th:nth-child(2) { width: 40%; }
.data.versus tbody tr:last-child th { border-bottom: 0; }
.data.versus thead th { padding-top: var(--space-2); padding-bottom: var(--space-2); white-space: normal; }
.data.versus thead th:last-child .club { flex-direction: row-reverse; text-align: right; }

/* Play-by-play */
.report {
  list-style: none; padding: 0; margin: 0; overflow: hidden;
  border: 1px solid var(--md-outline-variant); border-radius: var(--radius-md);
}
.report.major-only .minor { display: none; }
.ev {
  display: grid; grid-template-columns: 44px 10px minmax(0, 1fr) auto; column-gap: var(--space-3); align-items: start;
  padding: calc(var(--space-2) + var(--space-1) / 2) var(--space-4); border-bottom: 1px solid var(--md-outline-variant);
}
.ev:last-child { border-bottom: 0; }
.ev .clock { color: var(--md-on-surface-variant); }
.ev .dot { width: 10px; height: 20px; }
.ev .dot circle { stroke: var(--md-outline-variant); }
.ev-penalty .dot circle { fill: var(--md-error); stroke: var(--md-error); }
.ev small { display: block; margin-top: calc(var(--space-1) / 2); font-weight: 400; color: var(--md-on-surface-variant); }
.ev-goal { font-weight: 500; }
.ev-goal .clock { font-weight: 400; }
.ev .at {
  min-width: 36px; padding: 0 var(--space-2); border-radius: var(--radius-sm); text-align: center;
  background: var(--md-primary-container); color: var(--md-on-primary-container);
}
.ev-period, .ev-final {
  padding-top: var(--space-2); padding-bottom: var(--space-2); font-weight: 500;
  background: var(--md-surface-container-low); color: var(--md-on-surface-variant);
}

@media (max-width: 560px) {
  .scoreboard { gap: var(--space-2) var(--space-3); padding: var(--space-4); }
  .scoreboard .result { display: contents; }
  .scoreboard .side { grid-row: 1; align-self: start; }
  .scoreboard .side:last-child { grid-column: 3; }
  .scoreboard .big-score { grid-row: 1; grid-column: 2; align-self: start; }
  .scoreboard .result > :not(.big-score) { grid-column: 1 / -1; justify-self: center; }
  .big-score { font: 400 45px/52px var(--font-sans); }
  .crest.lg { width: 48px; height: 56px; }
  .fixtures li:has(.when) {
    grid-template-columns: minmax(0, 1fr) 72px minmax(0, 1fr);
    padding-top: var(--space-2); padding-bottom: var(--space-2);
  }
  .fixtures .when { grid-column: 1 / -1; }
}

/* Pages without a world: one centred column. */
.narrow { max-width: var(--column-form); margin: var(--space-6) auto; }
.narrow.settings { max-width: var(--column-settings); }
.narrow.letter { max-width: var(--column-letter); }
.narrow > h1 { margin-bottom: var(--space-2); }
.narrow > h1 + p { margin-bottom: var(--space-4); }
.narrow > h1:has(+ form) { margin-bottom: var(--space-4); }

/* Guide: the contents beside the chapters, each chapter under its icon, then
   paragraphs, a screenshot and explained terms. */
.guide { max-width: var(--column-letter); margin: var(--space-6) auto; }
.guide-head h1 { margin-bottom: var(--space-2); }
.guide-head p { margin: 0 0 var(--space-4); }
.toc { padding: var(--space-2); margin-bottom: var(--space-6); }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc a {
  display: flex; align-items: center; gap: var(--space-3); min-height: var(--control-height); padding: 0 var(--space-3);
  border-radius: var(--radius-full); font-weight: 500;
}
.toc a .icon { width: 20px; height: 20px; flex: none; }
.toc a:hover { background: var(--md-surface-container-highest); }
.toc a[aria-current="true"] { background: var(--md-secondary-container); color: var(--md-on-secondary-container); }
.guide section { scroll-margin-top: var(--space-4); }
.guide section + section { margin-top: calc(var(--space-6) * 2); }
.guide b { font-weight: 700; }
.chapter-title { display: flex; align-items: center; gap: var(--space-3); margin-top: 0; }
.chapter-icon {
  flex: none; display: flex; align-items: center; justify-content: center; width: var(--control-height); height: var(--control-height);
  border-radius: var(--radius-full); background: var(--md-primary-container); color: var(--md-on-primary-container);
}
.terms { display: grid; gap: var(--space-1); margin: var(--space-4) 0 0; }
.terms dt { font-weight: 500; }
.terms dd { margin: 0 0 var(--space-3); }
.guide .terms { gap: 0; }
.guide .terms dt { font: 500 16px/24px var(--font-sans); padding-top: var(--space-3); border-top: 1px solid var(--md-outline-variant); }
.guide .terms dd { margin: var(--space-1) 0 var(--space-3); }
.page-tiles {
  list-style: none; margin: var(--space-4) 0 0; padding: 0; display: grid; gap: var(--space-3);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
}
.page-tiles h3 { display: flex; align-items: center; gap: var(--space-2); margin: 0 0 var(--space-1); font: 500 16px/24px var(--font-sans); }
.page-tiles h3 .icon { color: var(--md-primary); flex: none; }
.page-tiles p { margin: 0; color: var(--md-on-surface-variant); }
@media (min-width: 1000px) {
  .wrap:has(> .guide) { max-width: var(--column-guide); }
  .guide { max-width: none; }
  .guide-body { display: grid; grid-template-columns: var(--column-toc) minmax(0, 1fr); gap: calc(var(--space-6) * 2); }
  .toc { position: sticky; top: var(--space-6); align-self: start; margin-bottom: 0; }
}

/* On a wide screen a term's name stands beside its explanation. */
@media (min-width: 1400px) {
  .guide .terms { grid-template-columns: var(--column-toc) minmax(0, 1fr); column-gap: var(--space-6); }
  .guide .terms dd { margin: 0; padding-top: var(--space-3); padding-bottom: var(--space-3); border-top: 1px solid var(--md-outline-variant); }
}

/* A form in a card of its own: sign in, create account, settings, a message. */
.account { padding: var(--space-6); margin-bottom: var(--space-6); }
.account > .error, .account > .saved { margin-bottom: 0; }
.account > label:first-child, .account > .field-label:first-child { margin-top: 0; }
.account > input, .account > select { max-width: none; }
.account > .btn { justify-self: start; margin-top: var(--space-3); }
.account > p:last-child { margin: var(--space-2) 0 0; }
.account > p a { font-weight: 500; }
.account .count { justify-self: end; }
input[aria-invalid="true"] { border: 2px solid var(--md-error); }
.field-error { color: var(--md-error); }

/* The clubs a manager has, on the settings page. */
.my-clubs {
  list-style: none; margin: 0; padding: 0; overflow: hidden;
  border: 1px solid var(--md-outline-variant); border-radius: var(--radius-md);
}
.my-clubs li {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); min-height: 64px;
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4); border-bottom: 1px solid var(--md-outline-variant);
}
.my-clubs li:last-child { border-bottom: 0; }
.my-clubs li > div { flex: 1 1 200px; display: grid; justify-items: start; gap: calc(var(--space-1) / 2); min-width: 0; }
.my-clubs li > div a.muted { color: var(--md-on-surface-variant); }
.my-clubs form { margin: 0; }

/* Choosing a club */
.fixtures.teams li { grid-template-columns: minmax(0, 1fr) 100px 168px; column-gap: var(--space-3); min-height: 56px; }
.fixtures.teams .club { gap: calc(var(--space-2) + var(--space-1) / 2); }
.crest.md { width: 24px; height: 28px; }
.crest.md text { display: none; }
.fixtures.teams li > :last-child { justify-self: end; }

/* Segmented buttons: radio inputs shown as one pill of equal segments. */
.segmented {
  display: inline-flex; justify-self: start; align-self: flex-start; max-width: 100%;
  border: 1px solid var(--md-outline); border-radius: var(--radius-full); overflow: hidden;
}
.segmented label { position: relative; margin: 0; }
.segmented input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.segmented span {
  display: flex; align-items: center; justify-content: center; gap: var(--space-2); min-width: 104px;
  height: var(--control-height); padding: 0 var(--space-4); font-weight: 500; white-space: nowrap;
}
.segmented label + label span { border-left: 1px solid var(--md-outline); }
.segmented input:checked + span { background: var(--md-secondary-container); color: var(--md-on-secondary-container); }
.segmented input:checked + span::before {
  content: ""; flex: none; width: 16px; height: 16px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.segmented input:focus-visible + span { outline: 2px solid var(--md-primary); outline-offset: -2px; }
/* A palette's dot: its data-palette gives it that palette's colours. */
.palette-dot {
  flex: none; width: 16px; height: 16px; border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--md-primary) 50%, var(--md-primary-container) 50%);
  box-shadow: 0 0 0 1px var(--md-outline-variant);
}
@media (max-width: 560px) {
  .segmented span { min-width: 0; padding: 0 var(--space-3); }
}

/* Forms in cards: a label, its control and a hint, one under the other. */
.fields { display: grid; gap: var(--space-2); margin-bottom: var(--space-4); }
.fields label, .fields .field-label { margin-top: var(--space-3); }
.fields h2 + label, .fields h2 + .field-label, .fields .segmented label { margin-top: 0; }
.field-label { font-weight: 500; }
.form-actions { margin-top: var(--space-4); }
.grid.top { align-items: start; }
.grid.top > div { display: grid; gap: var(--space-4); }
.grid.top .fields { margin-bottom: 0; }
.shapes > .fields > label:first-child { margin-top: 0; }

/* Lineup and special teams: places in rows that mirror the floor. */
.lines { display: grid; gap: var(--space-4); }
.lines.units { grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); }
.special-teams { display: grid; gap: var(--space-3); }
.special-teams > h2, .special-teams > p { margin: 0; }
.floor { display: grid; gap: var(--space-3); }
.floor h2 { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-4); margin: 0; }
.chem { display: flex; align-items: center; gap: var(--space-2); font: 500 12px/16px var(--font-sans); color: var(--md-on-surface-variant); }
.chem .track { flex: none; width: 96px; }
.chem b { font-weight: 500; color: var(--md-on-surface); }
.floor .row { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-3); }
.place {
  flex: 1 1 200px; min-width: 0; max-width: 280px; display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-3); border-radius: var(--radius-md); background: var(--md-surface-container-high);
  outline: 2px solid transparent;
}
.units .place { flex-basis: 150px; max-width: 240px; }
.place-head { display: flex; align-items: center; gap: var(--space-2); min-height: 24px; }
.place-name { flex-grow: 1; font: 500 12px/16px var(--font-sans); color: var(--md-on-surface-variant); }
.place-head .status { margin-left: 0; }
.place select { width: 100%; font-weight: 500; }
.place select.unset { font-weight: 400; }
.place select.role {
  height: 36px; padding: 0 var(--space-2); border-color: var(--md-outline-variant); background: transparent;
  color: var(--md-on-surface-variant); font-size: 12px; font-weight: 400;
}
.place.shown, .place.over { background: var(--md-secondary-container); outline-color: var(--md-primary); }
.place.swapped { outline-color: var(--md-primary); }
.place.dragging { opacity: 0.45; }
.grip { flex: none; margin-left: auto; color: var(--md-outline); cursor: grab; user-select: none; }

/* Lineup: the lines with a panel of player details beside them. */
.lineup-layout { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-6); margin-bottom: var(--space-4); }
.lineup-layout .lines { flex: 999 1 520px; min-width: 0; }
.player-panel { flex: 1 1 300px; min-width: 0; display: grid; gap: var(--space-4); }
@media (min-width: 1100px) {
  .player-panel { position: sticky; top: var(--space-3); max-height: calc(100vh - var(--space-6)); overflow-y: auto; }
}
.player-panel h2 { font: 500 16px/24px var(--font-sans); margin: 0; }
.player-panel p { margin: 0; }
.player-card { display: grid; gap: var(--space-4); }
.player-card[hidden] { display: none; }
.player-card header { display: flex; align-items: center; gap: var(--space-3); }
.player-card header > div { min-width: 0; display: grid; gap: calc(var(--space-1) / 2); }
.player-card .card-name { font: 500 16px/24px var(--font-sans); }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); }
.meta .status { margin-left: 0; }
.player-card .meta { font-size: 12px; line-height: 16px; color: var(--md-on-surface-variant); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
.fields.captain, .kept { margin-top: var(--space-4); }
.fields.captain > label { font: 500 16px/24px var(--font-sans); margin-top: 0; }
.kept-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.kept-row input { flex: 1 1 220px; min-width: 0; max-width: 360px; height: var(--tab-height); }

/* Tactics */
.split-bar { display: flex; gap: calc(var(--space-1) / 2); height: 8px; border-radius: var(--radius-xs); overflow: hidden; }
.split-bar span { background: var(--md-primary); }
.split-bar span:nth-child(2) { opacity: 0.6; }
.split-bar span:nth-child(3) { opacity: 0.3; }
.split { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.split label { flex: 1 1 96px; display: grid; gap: var(--space-2); margin: 0; }
.split input { width: 100%; }
.shooter { display: flex; align-items: center; gap: var(--space-3); }
.shooter .order {
  flex: none; width: 24px; height: 24px; border-radius: var(--radius-full); display: flex; align-items: center;
  justify-content: center; background: var(--md-surface-container-highest); font: 500 12px/16px var(--font-sans);
}
.shooter select { flex: 1 1 auto; min-width: 0; max-width: 360px; height: var(--control-height); }

/* Training */
.week { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--space-2); }
.fields .week label {
  display: flex; flex-direction: column; gap: var(--space-2); margin: 0; padding: var(--space-3);
  border-radius: var(--radius-md); background: var(--md-surface-container-high);
}
.fields .week label.match-day { background: var(--md-tertiary-container); color: var(--md-on-tertiary-container); }
.week select { width: 100%; }
.week small { min-height: 16px; font-weight: 400; }
.fields .week label.next-day { outline: 2px solid var(--md-primary); outline-offset: -2px; }
.week small.match-tomorrow, .tw-tomorrow { color: var(--md-error); }

@media (max-width: 560px) {
  .hero-actions { margin-left: 0; align-items: flex-start; }
  .fixtures.teams li { grid-template-columns: 1fr auto; padding-top: var(--space-2); padding-bottom: var(--space-2); }
  .fixtures.teams li > :last-child { grid-column: 1 / -1; justify-self: start; }
}

/* Transfers */
.deal { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3) var(--space-6); margin-bottom: var(--space-4); }
.deal > div:first-child { flex: 1 1 320px; min-width: 0; }
.deal b { font-weight: 500; }
.deal p { margin: calc(var(--space-1) / 2) 0 0; }
.deal .btn-row { align-items: center; }
.deal form { display: flex; align-items: center; gap: var(--space-2); margin: 0; }
.deal form.inline input { width: 72px; flex: none; }

/* Admin */
form.inline { display: flex; gap: var(--space-2); align-items: center; margin: 0; }
form.inline input { flex: 0 0 auto; width: 104px; }
.btn-row.end { justify-content: flex-end; gap: var(--space-1); flex-wrap: nowrap; }
.btn-row form { margin: 0; }
.scroll + p:has(> .btn) { margin-top: var(--space-3); }
.data td.name { font-weight: 500; }
/* A notice with something to pass on: the password link of a user. */
.notice {
  display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); padding: var(--space-4);
  margin-bottom: var(--space-6); border-radius: var(--radius-md);
  background: var(--md-tertiary-container); color: var(--md-on-tertiary-container);
}
.notice b { font-weight: 500; }
.next-stages ul { display: flex; flex-direction: column; gap: var(--space-1); margin: 0; padding: 0; list-style: none; }
code { font: 400 13px/20px var(--font-mono); }
.notice code, .codes code {
  display: inline-block; max-width: 100%; padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm);
  overflow-wrap: anywhere; user-select: all;
}
.notice code { background: var(--md-surface); color: var(--md-on-surface); }
.codes code { border: 1px solid var(--md-outline-variant); }
.codes { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--space-2); flex-wrap: wrap; }

/* Match replay */
.replay-bar {
  display: none; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4);
  padding: var(--space-2) var(--space-4); margin-bottom: var(--space-6);
  border-radius: var(--radius-md); background: var(--md-surface-container-high);
}
.replaying .replay-bar { display: flex; }
.replay-bar .clock { min-width: 64px; font: 400 22px/28px var(--font-sans); }
.replay-bar .grow { flex: 1; }
.replaying .after-replay, .replaying [data-toggle="report"] { display: none; }
.replaying .report .ev { display: none; }
.replaying .report .ev.shown { display: grid; }
.replaying .grid.two.wide-left { grid-template-columns: 1fr; }
.ev.fresh { animation: arrive 0.5s ease-out; }
@keyframes arrive { from { background: var(--md-primary-container); } }

/* Replay rink: the floor of the Tactics page rink with the twelve players
   and the ball, in the clubs' colours (--home, --away and their inks, set on
   the svg). It shows only while app.js plays it, and sticks to the top of
   the window with the scoreboard while the play-by-play scrolls under them. */
.replay-rink { display: none; width: 100%; max-height: 40vh; margin-bottom: var(--space-6); }
.replaying.animated .replay-rink { display: block; }
.replaying.animated .match-head {
  position: sticky; top: 0; z-index: 1; padding: var(--space-2) 0 var(--space-3); background: var(--md-surface);
}
.replaying.animated .scoreboard { margin-bottom: var(--space-3); }
.replaying.animated .replay-rink { margin-bottom: 0; }
.rink-dot circle { fill: var(--home); stroke: var(--md-surface); stroke-width: 1.5; }
.rink-dot circle.rk-shine { fill: var(--md-surface); stroke: none; }
.rink-dot text {
  fill: var(--md-on-surface); font: 600 8px/1 var(--font-sans); text-anchor: middle;
  stroke: var(--md-surface-container-low); stroke-width: 2.5; stroke-linejoin: round; paint-order: stroke;
}
.rink-dot.away circle:not(.rk-shine) { fill: var(--away); }
.rink-dot.keeper circle:not(.rk-shine) { stroke: var(--md-on-surface); stroke-width: 3; }
.rink-dot.off { opacity: 0.4; }
.rink-ball { fill: var(--md-surface); stroke: var(--md-on-surface); stroke-width: 1.5; }
/* Between actions the play goes out of focus under the match clock; app.js
   sets how far, the clock's opacity with it. */
.rink-lull { opacity: 0; pointer-events: none; }
.rink-lull rect { fill: var(--md-surface-container-high); rx: var(--radius-sm); }
.rink-lull text {
  fill: var(--md-on-surface); font: 400 18px/1 var(--font-sans); font-variant-numeric: tabular-nums;
  text-anchor: middle; dominant-baseline: central;
}
/* After a goal: rings in the scorer's colour spread from the net he scored
   in, and a banner over centre ice names him and the score. app.js turns it
   on (.on), sets the side (.away) and restarts the rings (.go); with
   reduced motion only the banner shows. */
.rink-scored { opacity: 0; pointer-events: none; transition: opacity 0.2s ease-out; }
.rink-scored.on { opacity: 1; }
.rink-burst circle {
  fill: none; stroke: var(--home); stroke-width: 3; vector-effect: non-scaling-stroke;
  opacity: 0; transform-box: fill-box; transform-origin: center;
}
.rink-scored.away .rink-burst circle { stroke: var(--away); }
@media (prefers-reduced-motion: no-preference) {
  .rink-burst.go circle { animation: rink-burst 1s ease-out backwards; }
  .rink-burst.go circle:nth-child(2) { animation-delay: 0.15s; }
  .rink-burst.go circle:nth-child(3) { animation-delay: 0.3s; }
}
@media (prefers-reduced-motion: reduce) { .rink-scored { transition: none; } }
@keyframes rink-burst { from { opacity: 0.9; transform: scale(1); } to { opacity: 0; transform: scale(7); } }
.rink-banner rect { fill: var(--md-surface-container-high); stroke: var(--md-outline-variant); rx: var(--radius-sm); }
.rink-banner-dot { fill: var(--home); stroke: var(--md-surface); stroke-width: 1.5; }
.rink-scored.away .rink-banner-dot { fill: var(--away); }
.rink-banner text { text-anchor: middle; dominant-baseline: central; }
.rink-banner-title {
  fill: var(--md-primary); font: 700 17px/1 var(--font-sans); text-transform: uppercase; letter-spacing: 0.12em;
}
.rink-banner-text { fill: var(--md-on-surface); font: 500 11px/1 var(--font-sans); font-variant-numeric: tabular-nums; }
/* The running score blinks as a new event's line does when a goal falls. */
.replaying .big-score { padding: 0 var(--space-3); border-radius: var(--radius-md); }
.big-score.scored { animation: arrive 0.9s ease-out; }
/* A line of the play-by-play plays its moment on the rink when clicked
   (data-seek, set by app.js). */
.ev[data-seek] { cursor: pointer; }
.ev[data-seek]:hover { background: var(--md-surface-container-low); }
/* On a phone the floor is drawn at about four fifths of its size: the dots
   and their numbers grow back so that the numbers stay readable. */
@media (max-width: 560px) {
  .rink-dot circle:not(.rk-shine) { r: 10px; }
  .rink-dot text { font-size: 10px; }
  .rink-ball { r: 4.5px; }
}

/* Error pages */
.problem {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-3); text-align: center;
  max-width: var(--column-settings); margin: 0 auto; padding: calc(var(--space-6) * 2) 0;
}
.problem .code { font: 400 96px/104px var(--font-sans); color: var(--md-primary); }
.problem h1, .problem p { margin: 0; }
.problem .btn { margin-top: var(--space-3); }

/* Confirmation dialog: asked before a form that cannot be taken back. */
.dialog {
  width: 360px; max-width: calc(100% - var(--space-6) * 2); padding: var(--space-6); border: 0;
  border-radius: var(--radius-lg); background: var(--md-surface-container-high); color: var(--md-on-surface);
}
.dialog::backdrop { background: var(--md-scrim); }
.dialog h2 { margin: 0 0 var(--space-4); }
.dialog p { margin: 0; color: var(--md-on-surface-variant); }
.dialog .actions { display: flex; justify-content: flex-end; gap: var(--space-2); margin: var(--space-6) 0 0; }
.dialog .btn.danger { border-color: transparent; background: var(--md-error); color: var(--md-surface); }

/* Shown while a form that takes a while is being answered. */
.busy {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  background: var(--md-scrim);
}
.busy[hidden] { display: none; }
.busy-box {
  display: flex; align-items: center; gap: var(--space-4); max-width: calc(100% - var(--space-6) * 2);
  padding: calc(var(--space-4) + var(--space-1)) var(--space-6); border-radius: var(--radius-lg);
  background: var(--md-surface-container-high); font: 400 16px/24px var(--font-sans);
}
.spinner {
  flex: none; width: 32px; height: 32px; border-radius: var(--radius-full);
  border: 4px solid var(--md-surface-container-highest); border-top-color: var(--md-primary);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }
/* The desktop app's window while the game starts. */
.starting { display: grid; justify-items: center; gap: var(--space-4); padding-top: var(--space-6); text-align: center; }
.starting h1, .starting p { margin: 0; }
.starting .spinner { width: 48px; height: 48px; border-width: 5px; }

/* The head of a competition: its name with the league and season pickers. */
.league-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-4) var(--space-6); margin-bottom: var(--space-4); }
.league-head h1 { flex: 1 1 280px; display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-3); margin: 0; }
.league-head h2 { flex: 1 1 280px; margin: 0; }
.league-head h1 small { font-size: 14px; line-height: 20px; }
.pickers { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.picker { display: grid; grid-template-columns: auto auto; gap: var(--space-1) var(--space-2); align-items: center; margin: 0; }
.picker label { grid-column: 1 / -1; font: 500 12px/16px var(--font-sans); color: var(--md-on-surface-variant); }
.picker select { min-width: 120px; padding: 0 var(--space-2); }
.picker.auto { grid-template-columns: auto; }
form.auto button, .picker.auto button { display: none; }

/* Rounds of fixtures and cup groups, side by side where there is room. */
.grid.rounds { grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); align-items: start; }
.grid.groups { grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr)); align-items: start; }
.round h2, .groups h2, .bracket-round h2 {
  display: flex; align-items: baseline; gap: var(--space-3); margin: 0 0 var(--space-2);
  font: 500 16px/24px var(--font-sans);
}
.round h2 small, .bracket-round h2 small { font-size: 14px; font-weight: 400; }
.groups + .legend { margin-top: calc(var(--space-4) * -1 + var(--space-2)); }
.groups { margin-bottom: var(--space-4); }

/* History of a competition */
.history td { vertical-align: top; padding-top: var(--space-3); padding-bottom: var(--space-3); white-space: normal; }
.awards { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-1); }

/* The cup's knockout rounds, side by side. */
.bracket-scroll { overflow-x: auto; margin-bottom: var(--space-6); }
.bracket { display: flex; gap: var(--space-6); min-width: 780px; }
.bracket-round { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; }
.ties { flex-grow: 1; display: flex; flex-direction: column; justify-content: space-around; gap: var(--space-3); }
.tie {
  display: flex; flex-direction: column; border: 1px solid var(--md-outline-variant); border-radius: var(--radius-md);
  overflow: hidden; background: var(--md-surface); color: var(--md-on-surface);
}
.tie:hover { border-color: var(--md-primary); color: var(--md-on-surface); }
.tie.mine { background: var(--md-secondary-container); color: var(--md-on-secondary-container); }
.tie .side {
  display: flex; align-items: center; gap: var(--space-2); min-height: var(--control-height);
  padding: 0 var(--space-3); color: var(--md-on-surface-variant);
}
.tie .side + .side { border-top: 1px solid var(--md-outline-variant); }
.tie .side.won { color: inherit; font-weight: 700; }
.tie .name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tie small { font-size: 11px; font-weight: 500; color: var(--md-on-surface-variant); }
.tie b { width: 20px; text-align: right; font-weight: 700; }

/* Customizing names */
input[type="file"] { padding: var(--space-2); max-width: 220px; flex: 0 1 auto; border: 0; background: transparent; color: var(--md-on-surface-variant); }
input[type="color"] { padding: var(--space-1); width: 72px; height: var(--tab-height); flex: none; }
.custom-pack { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-6); margin-bottom: var(--space-6); }
.custom-pack > div:first-child { flex: 1 1 360px; min-width: 0; }
.custom-pack h2 { font: 500 16px/24px var(--font-sans); margin: 0 0 var(--space-1); }
.custom-pack p { margin: 0; }
.custom-pack .btn-row { align-items: center; }
.custom-pack form { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; margin: 0; }

/* Disclosure: a bordered row that opens to a form. */
.custom-club { overflow: hidden; margin-bottom: var(--space-2); border: 1px solid var(--md-outline-variant); border-radius: var(--radius-md); }
.custom-club summary {
  display: flex; align-items: center; gap: var(--space-3); min-height: 56px; padding: 0 var(--space-4);
  font-weight: 500; cursor: pointer; list-style: none;
}
.custom-club summary::-webkit-details-marker { display: none; }
.custom-club summary .name { flex: 1; min-width: 0; }
.custom-club summary::after, .calendar-earlier summary::after {
  content: ""; flex: none; width: 20px; height: 20px; background: var(--md-on-surface-variant);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
}
.custom-club[open] summary { background: var(--md-surface-container-low); }
.custom-club[open] summary::after { transform: rotate(180deg); }
.custom-club > form:not(:empty) { display: grid; gap: var(--space-4); padding: var(--space-4); }
.custom-fields { display: flex; gap: var(--space-3) var(--space-4); flex-wrap: wrap; align-items: end; }
.custom-fields label { display: grid; gap: var(--space-2); flex: 2 1 180px; }
.custom-fields label:has(input[type="color"]) { flex: none; }
.custom-fields label:has(input[name="short"]) { flex: 1 1 96px; }
.custom-fields input:not([type="color"]) { width: 100%; }
.club-settings { display: grid; gap: var(--space-4); }
.club-settings > h2, .club-settings > p { margin: 0; }
.custom-roster { min-width: 560px; }
.custom-roster input { width: 100%; }

/* Style guide: every part once, each in a card under its name. */
.samples { display: grid; gap: var(--space-4); }
.sample { min-width: 0; }
.sample > * + * { margin-top: var(--space-3); }
.sample-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-4); }
.sample-row .place { flex: 0 1 240px; }
.sample .type > * { margin: 0 0 var(--space-2); }
.sample .rail {
  width: auto; flex-direction: row; justify-content: flex-start; position: static;
  border-radius: var(--radius-md); background: var(--md-surface-container);
}
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--space-2); }
.swatch {
  display: flex; align-items: flex-end; min-height: 64px; padding: var(--space-2) var(--space-3);
  border: 1px solid var(--md-outline-variant); border-radius: var(--radius-sm); font: 500 12px/16px var(--font-sans);
}
.foot { margin-top: var(--space-6); }

/* Landing page: what a visitor sees at / before signing in. */
.landing > section { margin-bottom: calc(var(--space-6) * 2); }
.hero { display: grid; gap: var(--space-6); align-items: center; }
.hero h1 { font: 400 var(--display-size)/var(--display-line) var(--font-sans); margin: 0 0 var(--space-3); }
.landing .hero h1 { max-width: 420px; margin-bottom: var(--space-6); text-wrap: balance; }
.landing .hero h1 .then { color: var(--md-primary); }
@media (prefers-reduced-motion: no-preference) {
  .landing .hero h1 .then { animation: then 0.6s ease-out 1.05s backwards; }
}
@keyframes then { from { opacity: 0; } }
@media (min-width: 900px) {
  .landing .hero { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: calc(var(--space-6) * 3); }
}
.landing-match { display: grid; gap: var(--space-3); min-width: 0; margin: 0; }
.landing-match .scoreboard { padding: var(--space-4) var(--space-6); margin: 0; }
.landing-match .big-score { font: 400 45px/52px var(--font-sans); }
.landing-match .crest.lg { width: 48px; height: 56px; }
.landing-match figcaption { color: var(--md-on-surface-variant); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.steps li { border-top: 2px solid var(--md-primary); padding-top: var(--space-3); }
.steps h2 { font: 500 16px/24px var(--font-sans); margin: 0; }
.steps p { margin: 0; color: var(--md-on-surface-variant); }
.world-strip { display: grid; gap: var(--space-3); }
.world-strip .stats { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.world-strip p { margin: 0; }
.release { display: grid; gap: var(--space-3); justify-items: start; margin-bottom: var(--space-6); }
.release .stats { justify-self: stretch; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); }
.release p { margin: 0; }
.release code { overflow-wrap: anywhere; }
/* The licenses of the software the game is built with. */
.notices { display: grid; gap: var(--space-2); margin-top: var(--space-4); }
.notice { border: 1px solid var(--md-outline-variant); border-radius: var(--radius-md); overflow: hidden; }
.notice summary { display: flex; gap: var(--space-2); align-items: baseline; padding: var(--space-3) var(--space-4); cursor: pointer; }
.notice summary .name { font-weight: 500; overflow-wrap: anywhere; }
.notice[open] summary { background: var(--md-surface-container-low); }
.notice pre { margin: 0; padding: var(--space-4); max-height: 360px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; }
.shot { margin: 0; }
.shot a { display: block; }
.shot img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--md-outline-variant); border-radius: var(--radius-md);
}
.shot figcaption { margin-top: var(--space-2); color: var(--md-on-surface-variant); }
.shot a.shot-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .shot a.shot-dark { display: block; }
  :root:not([data-theme="light"]) .shot a.shot-light { display: none; }
}
:root[data-theme="dark"] .shot a.shot-dark { display: block; }
:root[data-theme="dark"] .shot a.shot-light { display: none; }

/* The changelog: entries in cards, the text written in Markdown. */
.entry-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.card.entry .entry-head h2 { flex: 1 1 auto; margin: 0; font: 400 22px/28px var(--font-sans); }
.entry-head .status { margin: 0; }
.entry-date { margin: var(--space-1) 0 var(--space-3); }
.card.entry > :last-child { margin-bottom: 0; }
.card.entry > .btn-row { margin-top: var(--space-2); }
.changelog-preview > h2 { margin: 0 0 var(--space-3); }
.account > .btn-row { margin-top: var(--space-3); }
.stack > .account { margin: 0; }
.prose { overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose h1, .prose h2 { font: 500 16px/24px var(--font-sans); margin: var(--space-4) 0 var(--space-2); }
.prose h3, .prose h4, .prose h5, .prose h6 { font: 500 14px/20px var(--font-sans); margin: var(--space-3) 0 var(--space-1); }
.prose ul, .prose ol { margin: 0 0 var(--space-3); padding-left: var(--space-6); }
.prose li + li { margin-top: var(--space-1); }
.prose blockquote {
  margin: 0 0 var(--space-3); padding: var(--space-1) var(--space-4);
  border-left: 4px solid var(--md-outline-variant); color: var(--md-on-surface-variant);
}
.prose code { padding: 0 var(--space-1); border-radius: var(--radius-sm); background: var(--md-surface-container-high); }
.prose pre {
  margin: 0 0 var(--space-3); padding: var(--space-3); overflow-x: auto;
  border-radius: var(--radius-sm); background: var(--md-surface-container-high);
}
.prose pre code { padding: 0; background: none; }
.prose hr { border: 0; border-top: 1px solid var(--md-outline-variant); margin: var(--space-4) 0; }
.prose img { max-width: 100%; }

/* The footer of every page. */
footer.site {
  display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6);
  padding: var(--space-4) var(--space-6); border-top: 1px solid var(--md-outline-variant);
  color: var(--md-on-surface-variant);
}
footer.site a { color: var(--md-primary); }
body > main { flex: 1 0 auto; }

/* Rink: a defensive system or an attacking style drawn on the floor, the
   club's own goal on the left. Of the drawings in a .rinks card only the one
   of the chosen segment shows. */
.rink { display: none; width: 100%; max-width: var(--column-form); margin: var(--space-2) 0; }
.rinks:has(input[value="2-1-2"]:checked) .rink[data-choice="2-1-2"],
.rinks:has(input[value="2-2-1"]:checked) .rink[data-choice="2-2-1"],
.rinks:has(input[value="1-2-2"]:checked) .rink[data-choice="1-2-2"],
.rinks:has(input[value="counterattack"]:checked) .rink[data-choice="counterattack"],
.rinks:has(input[value="balanced"]:checked) .rink[data-choice="balanced"],
.rinks:has(input[value="build_up"]:checked) .rink[data-choice="build_up"] { display: block; }
.rink-floor { fill: var(--md-surface-container-low); }
/* The home club's crest at centre ice of the replay rink, faint under the
   lines and the players. */
.rink-crest { opacity: 0.16; }
.rink-edge { fill: none; stroke: var(--md-outline-variant); stroke-width: 2; }
.rink-line { fill: none; stroke: var(--md-outline-variant); stroke-width: 1.5; }
.rink-goal { fill: var(--md-outline); }
.rink-press { fill: var(--md-primary-container); }
.rink-open { fill: var(--md-tertiary-container); }
.rink-arrow { stroke: var(--md-primary); stroke-width: 2; stroke-dasharray: 6 4; }
.rink-arrow.shot { stroke-dasharray: none; stroke-width: 3; }
.rink-head { fill: var(--md-primary); }
/* The places take the colours of the position badges, outlined so they
   stand out on a zone of the same colour. */
.rink-place { stroke: var(--md-outline); stroke-width: 1.5; }
.rink-place.rink-D { fill: var(--md-secondary-container); }
.rink-place.rink-C { fill: var(--md-primary-container); }
.rink-place.rink-W { fill: var(--md-tertiary-container); }
.rink-legend { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); }
.rink-legend .legend { margin: 0; }
.rink-direction { stroke: var(--md-on-surface-variant); stroke-width: 2.5; }
.rink-direction-head { fill: var(--md-on-surface-variant); }
.rink-pos { font-size: 12px; font-weight: 700; text-anchor: middle; }
.rink-pos.rink-D { fill: var(--md-on-secondary-container); }
.rink-pos.rink-C { fill: var(--md-on-primary-container); }
.rink-pos.rink-W { fill: var(--md-on-tertiary-container); }

/* Islands: parts of a page that a Svelte component draws in place of the
   plain fields the server sends (frontend/, static/islands.js). The wrapper
   makes no box of its own, so the fields or the component stand in the page
   as its children would. */
.island { display: contents; }

/* A segmented button of the islands: buttons with a state in place of the
   radio inputs of .segmented. */
.seg {
  display: inline-flex; justify-self: start; max-width: 100%;
  border: 1px solid var(--md-outline); border-radius: var(--radius-full); overflow: hidden;
}
.seg-item {
  display: flex; align-items: center; justify-content: center; gap: var(--space-2); height: var(--control-height);
  padding: 0 var(--space-4); border: 0; background: transparent; color: var(--md-on-surface);
  font: 500 14px/20px var(--font-sans); white-space: nowrap; cursor: pointer;
}
.seg-item + .seg-item { border-left: 1px solid var(--md-outline); }
.seg-item:hover { background: color-mix(in srgb, var(--md-primary) 8%, transparent); }
.seg-item[data-state="checked"] { background: var(--md-secondary-container); color: var(--md-on-secondary-container); }
.seg-item:focus-visible { outline: 2px solid var(--md-primary); outline-offset: -2px; }
.seg-dot { flex: none; width: 6px; height: 6px; border-radius: var(--radius-full); background: var(--md-primary); }
@media (max-width: 560px) {
  .seg-item { padding: 0 var(--space-3); }
}

/* The board of systems and styles: the rink beside the choices, each choice
   a row with the club's mastery, the fit of the lines and the ring. */
.board-body {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: var(--space-4) var(--space-6); align-items: start; margin-top: var(--space-2);
}
.board-caption { margin: 0 0 var(--space-2); }
.board-floor { display: grid; gap: var(--space-2); }
.board-floor .rink-legend, .board-floor .board-caption { margin: 0; }
.board-choices, .option-group, .options { display: grid; gap: var(--space-2); }
.board-choices { gap: var(--space-4); }
.option {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: var(--space-1) var(--space-3);
  padding: var(--space-2) var(--space-3); border: 1px solid var(--md-outline-variant); border-radius: var(--radius-sm);
  background: transparent; color: var(--md-on-surface); font: 400 14px/20px var(--font-sans); text-align: left; cursor: pointer;
}
.option:hover { background: color-mix(in srgb, var(--md-primary) 8%, transparent); }
.option[data-state="checked"] {
  border-color: var(--md-primary); background: var(--md-secondary-container); color: var(--md-on-secondary-container);
}
.option:focus-visible { outline: 2px solid var(--md-primary); outline-offset: 2px; }
.option-name { font-weight: 500; }
.option-mastery, .option-fit { display: flex; align-items: center; gap: var(--space-2); font-size: 12px; }
.option-fit { grid-column: 1 / -1; flex-wrap: wrap; gap: var(--space-1); }
.option-fit .muted { margin-right: var(--space-1); }
.option-ring { grid-column: 1 / -1; font-size: 12px; color: var(--md-on-surface-variant); }
.fit-chip {
  padding: 0 var(--space-2); border-radius: var(--radius-full); background: var(--md-surface-container-highest);
  color: var(--md-on-surface); line-height: 20px; white-space: nowrap;
}
.fit-chip.fit-good { background: var(--md-primary-container); color: var(--md-on-primary-container); }
.fit-chip.fit-poor { background: var(--md-error-container); color: var(--md-on-error-container); }

/* Floor time as one bar with two handles (island). */
.split-island { display: grid; gap: var(--space-1); }
.split-slider { position: relative; display: flex; align-items: center; height: 32px; touch-action: none; user-select: none; }
.split-slider .split-bar { flex: 1 1 auto; }
.split-thumb {
  top: 4px; width: 4px; height: 24px; border-radius: var(--radius-full); background: var(--md-primary);
  box-shadow: 0 0 0 3px var(--md-surface); cursor: ew-resize;
}
.split-thumb::before { content: ""; position: absolute; inset: -4px -12px; }
.split-thumb:focus-visible { outline: 2px solid var(--md-primary); outline-offset: 4px; }
.split-values { display: flex; }
.split-values span {
  flex: 1 0 0; min-width: 0; text-align: center; font-size: 12px; white-space: nowrap; color: var(--md-on-surface-variant);
}
.split-values b { display: block; font: 500 16px/24px var(--font-sans); color: var(--md-on-surface); }

/* The order of the penalty shots as rows to drag (island). */
.shooters, .shooter-list { grid-template-columns: minmax(0, 1fr); }
.shooters { display: grid; gap: var(--space-2); }
.shooters p { margin: 0; }
.shooters > select { max-width: min(100%, 360px); height: var(--control-height); }
.shooter-list { display: grid; gap: var(--space-1); margin: 0; padding: 0; list-style: none; }
.shooter-list .shooter {
  padding-left: var(--space-2); border: 1px solid var(--md-outline-variant); border-radius: var(--radius-sm);
  background: var(--md-surface); cursor: grab;
}
.shooter-list .shooter.dragging { opacity: 0.4; }
.shooter-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shooter-acts { flex: none; display: flex; }
.shooter-acts .btn { width: var(--control-height); padding: 0; font-size: 16px; }

/* The rink of the islands (Rink.svelte): boards around a planked floor lit
   from the middle, the markings of a real rink and red goals with a net.
   The players (Token.svelte) are discs in the club's colours, --club and
   --club-ink, which a board sets from the club's first colour. */
.rk { display: block; width: 100%; height: auto; touch-action: manipulation; user-select: none; }
.rk-boards { fill: var(--md-surface-container-highest); stroke: var(--md-outline); stroke-width: 1.5; }
.rk-floor-top { stop-color: var(--md-surface-container-low); }
.rk-floor-bottom { stop-color: var(--md-surface-container); }
.rk-plank { fill: var(--md-surface-container-high); opacity: 0.35; }
.rk-seam { stroke: var(--md-outline-variant); stroke-width: 0.5; opacity: 0.5; }
.rk-light-in { stop-color: var(--md-surface); stop-opacity: 0.35; }
.rk-light-out { stop-color: var(--md-surface); stop-opacity: 0; }
.rk-line, .rk-area, .rk-keeper, .rk-edge { fill: none; stroke: var(--md-outline); stroke-width: 1.2; }
.rk-line { stroke-width: 1.6; }
.rk-area { fill: var(--md-primary); fill-opacity: 0.05; }
.rk-keeper { stroke-width: 1; }
.rk-edge { stroke: var(--md-outline-variant); stroke-width: 2; }
.rk-spot, .rk-dot { fill: var(--md-outline); }
.rk-goal { stroke: var(--md-error); stroke-width: 1.8; }
.rk-net { stroke: var(--md-error); stroke-width: 0.4; opacity: 0.6; }
.rk-way line { stroke: var(--md-on-surface-variant); stroke-width: 2.5; stroke-linecap: round; }
.rk-way polygon { fill: var(--md-on-surface-variant); }
.rk-press { fill: var(--md-primary-container); opacity: 0.85; }
.rk-open { fill: var(--md-tertiary-container); opacity: 0.85; }
.rk-arrow { stroke: var(--club, var(--md-primary)); stroke-width: 2; stroke-dasharray: 6 4; stroke-linecap: round; }
.rk-arrow.shot { stroke-dasharray: none; stroke-width: 3; }
.rk-head { fill: var(--club, var(--md-primary)); }
.rk-arrow.ghost { stroke: var(--md-on-surface-variant); stroke-width: 1.5; opacity: 0.55; }
.rk-head.ghost { fill: var(--md-on-surface-variant); opacity: 0.55; }

.rk-token { cursor: default; }
.rk-token.pickable { cursor: pointer; touch-action: none; }
.rk-token:focus { outline: none; }
.rk-shadow { fill: var(--md-on-surface); opacity: 0.18; }
.rk-halo { fill: none; stroke: var(--md-primary); stroke-width: 2.5; opacity: 0; }
.rk-token.pickable:hover .rk-halo { opacity: 0.35; }
.rk-token.selected .rk-halo, .rk-token:focus-visible .rk-halo { opacity: 1; }
.rk-token.target .rk-halo { opacity: 1; stroke-dasharray: 4 3; }
/* The outline keeps a club colour close to the floor (black in dark mode,
   white in light) apart from it. */
.rk-body { fill: var(--club, var(--md-primary)); stroke: var(--md-on-surface); stroke-width: 1.5; }
.rk-shine { fill: var(--md-surface); opacity: 0.22; }
.rk-number { fill: var(--club-ink, var(--md-on-primary)); font: 700 11px/1 var(--font-sans); text-anchor: middle; }
.rk-badge circle { fill: var(--md-surface-container-highest); stroke: var(--md-surface); stroke-width: 1.2; }
.rk-badge text { fill: var(--md-on-surface); font: 700 7px/1 var(--font-sans); text-anchor: middle; }
.rk-badge.rk-pos-D circle { fill: var(--md-secondary-container); }
.rk-badge.rk-pos-D text { fill: var(--md-on-secondary-container); }
.rk-badge.rk-pos-C circle { fill: var(--md-primary-container); }
.rk-badge.rk-pos-C text { fill: var(--md-on-primary-container); }
.rk-badge.rk-pos-W circle { fill: var(--md-tertiary-container); }
.rk-badge.rk-pos-W text { fill: var(--md-on-tertiary-container); }
.rk-name, .rk-note {
  fill: var(--md-on-surface); font: 600 9px/1 var(--font-sans); text-anchor: middle;
  stroke: var(--md-surface-container-low); stroke-width: 3; stroke-linejoin: round; paint-order: stroke;
}
.rk-note { fill: var(--md-on-surface-variant); font-weight: 500; font-size: 8px; }
.rk-ghost .rk-body { fill: var(--md-surface); fill-opacity: 0.5; stroke: var(--md-on-surface-variant); stroke-width: 1.5; stroke-dasharray: 3 2; }
.rk-ghost .rk-number { fill: var(--md-on-surface-variant); font-size: 9px; }
.rk-empty .rk-body { fill: var(--md-surface); fill-opacity: 0.7; stroke: var(--md-outline); stroke-width: 1.5; stroke-dasharray: 4 3; }
.rk-empty .rk-number { fill: var(--md-on-surface-variant); }
.rk-empty .rk-name { fill: var(--md-on-surface-variant); font-style: italic; }
.rk-usual .rk-body { opacity: 0.55; }
.rk-usual .rk-name { font-style: italic; }
.rk-out .rk-body { stroke: var(--md-error); stroke-width: 2.5; }
.dragged > .rk-token { opacity: 0.3; }
.rk-carried { opacity: 0.9; }
@media (prefers-reduced-motion: no-preference) {
  .rk-token.selected .rk-halo { animation: rk-pulse 1.6s ease-in-out infinite; }
}
@keyframes rk-pulse { 50% { stroke-opacity: 0.35; } }

/* Chips: small choices in a row, such as the opponent's choice laid over a
   board, and labels such as where a player stands. */
.chips { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.chip {
  display: inline-flex; align-items: center; height: 24px; padding: 0 var(--space-2);
  border: 1px solid var(--md-outline-variant); border-radius: var(--radius-sm); background: transparent;
  color: var(--md-on-surface-variant); font: 500 12px/16px var(--font-sans); white-space: nowrap;
}
button.chip { height: 32px; padding: 0 var(--space-3); cursor: pointer; }
button.chip:hover { background: color-mix(in srgb, var(--md-primary) 8%, transparent); }
.chip.on { border-color: transparent; background: var(--md-secondary-container); color: var(--md-on-secondary-container); }
.against { display: grid; gap: var(--space-2); }
.against-label { font-weight: 500; }
.verdict { margin: 0; padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); font-weight: 500; }
.verdict-wins { background: var(--md-primary-container); color: var(--md-on-primary-container); }
.verdict-loses { background: var(--md-error-container); color: var(--md-on-error-container); }
.verdict-even { background: var(--md-surface-container-high); color: var(--md-on-surface); }
.seg-kind { flex: none; width: 8px; height: 8px; border-radius: var(--radius-full); background: var(--md-primary); }
.seg-kind.seg-box { background: var(--md-error); }
.seg-chem {
  padding: 0 var(--space-1); border-radius: var(--radius-xs); background: var(--md-surface-container-high);
  color: var(--md-on-surface-variant); font-size: 11px; line-height: 16px;
}
.seg-chem.stale { opacity: 0.5; }

/* The lineup as a board (LineupBoard.svelte): the rink with the place picked
   and the player there beside the list of players to pick from. */
.lb { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--space-4); align-items: start; }
@media (max-width: 900px) { .lb { grid-template-columns: minmax(0, 1fr); } }
.lb-board { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
.lb-tabs { display: flex; flex-wrap: wrap; gap: var(--space-2); min-width: 0; }
.lb-tabs .seg { flex: 0 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.lb-tabs .seg::-webkit-scrollbar { display: none; }
/* On a phone the rink is small: the players grow so their names can be read. */
@media (max-width: 560px) {
  .rk-scale { transform: scale(1.3); }
}
.lb-place { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); min-height: var(--control-height); }
.lb-place-name { font-weight: 500; margin-right: auto; }
.lb-place select { height: var(--control-height); max-width: 100%; }
.lb-hint { margin: 0; min-height: var(--control-height); display: flex; align-items: center; }
.lb-card { display: grid; gap: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--md-outline-variant); }
.lb-card header { display: flex; align-items: center; gap: var(--space-3); }
.lb-card header > div:not(.lb-big) { flex: 1 1 auto; min-width: 0; display: grid; gap: calc(var(--space-1) / 2); }
.lb-card .card-name { font: 500 16px/24px var(--font-sans); }
.lb-card .meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-size: 12px; color: var(--md-on-surface-variant); }
.lb-card .meta .status { margin-left: 0; }
.lb-big { flex: none; display: grid; justify-items: center; }
.lb-big b { font: 500 28px/36px var(--font-sans); color: var(--md-primary); }
.lb-big span { font-size: 11px; color: var(--md-on-surface-variant); }
.lb-bars { font-size: 12px; line-height: 16px; }
.lb-bars dd { display: flex; align-items: center; gap: var(--space-2); margin: 0; }
.lb-bars b { width: 24px; text-align: right; }
/* The attributes as tiles: the name and the value on a line, a bar under
   them in the colour of the value's level. */
.lb-attrs {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 136px), 1fr)); gap: var(--space-2);
  margin: 0; padding: 0; list-style: none;
}
.lb-attr {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: var(--space-1) var(--space-2);
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); background: var(--md-surface-container);
}
.lb-attr-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--md-on-surface-variant); }
.lb-attr b { font: 500 16px/20px var(--font-sans); }
.lb-attr-bar { grid-column: 1 / -1; height: 4px; border-radius: var(--radius-xs); background: var(--md-surface-container-highest); overflow: hidden; }
.lb-attr-bar span { display: block; height: 100%; border-radius: inherit; background: var(--md-outline); }
.lb-mid .lb-attr-bar span { background: var(--md-on-secondary-container); }
.lb-hi { background: var(--md-primary-container); }
.lb-hi .lb-attr-name, .lb-hi b { color: var(--md-on-primary-container); }
.lb-hi .lb-attr-bar span { background: var(--md-primary); }
.lb-lo b { color: var(--md-on-surface-variant); }
.lb-mark { color: var(--md-primary); }
.lb-list h2 { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1); }
.lb-sorted { font-size: 12px; font-weight: 400; }
.lb-group {
  display: flex; align-items: center; gap: var(--space-2); margin: var(--space-4) 0 var(--space-1); padding-top: var(--space-3);
  border-top: 1px solid var(--md-outline-variant); font: 500 12px/16px var(--font-sans); color: var(--md-on-surface-variant); text-transform: uppercase;
}
.lb-list h2 + .lb-group { margin-top: 0; padding-top: 0; border-top: 0; }
/* The lines have a colour each, on their group headings and on the chips
   that say where a player stands. */
.lb-group.line::before { content: ""; flex: none; width: 12px; height: 12px; border-radius: var(--radius-xs); background: var(--md-surface-container-highest); }
.lb-group[data-line="1"]::before, .chip.line-1 { background: var(--md-primary-container); color: var(--md-on-primary-container); border-color: transparent; }
.lb-group[data-line="2"]::before, .chip.line-2 { background: var(--md-secondary-container); color: var(--md-on-secondary-container); border-color: transparent; }
.lb-group[data-line="3"]::before, .chip.line-3 { background: var(--md-tertiary-container); color: var(--md-on-tertiary-container); border-color: transparent; }
.chip.line-0 { background: var(--md-surface-container-highest); color: var(--md-on-surface); border-color: transparent; }
.lb-rows { display: grid; gap: calc(var(--space-1) / 2); margin: 0; padding: 0; list-style: none; }
.lb-row {
  display: grid; grid-template-columns: 24px minmax(0, 1fr) auto 40px 28px; align-items: center; gap: var(--space-2);
  width: 100%; min-height: var(--row-height); padding: var(--space-1) var(--space-2); border: 1px solid transparent;
  border-radius: var(--radius-sm); background: transparent; color: var(--md-on-surface);
  font: 400 14px/20px var(--font-sans); text-align: left; cursor: pointer;
}
.lb-row:hover { background: color-mix(in srgb, var(--md-primary) 8%, transparent); }
.lb-row:focus-visible { outline: 2px solid var(--md-primary); outline-offset: -2px; }
.lb-row.here, .lb-row.looked { border-color: var(--md-primary); background: var(--md-secondary-container); color: var(--md-on-secondary-container); }
.lb-row.in-unit { border-color: var(--md-outline-variant); }
.lb-row.out { opacity: 0.6; cursor: default; }
.lb-num { font-size: 12px; color: var(--md-on-surface-variant); text-align: right; }
.lb-who { display: grid; min-width: 0; }
.lb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.lb-where { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.lb-where:empty { display: none; }
.lb-where .status { margin-left: 0; }
.lb-energy .meter { width: 40px; }
.lb-rating { font: 500 16px/24px var(--font-sans); text-align: right; }

/* An island makes no box of its own, so a grid inside one keeps the 24px
   from the grid before it and after it, as two grids side by side do. */
:where(.grid, .island) + .island > :where(.grid):first-child,
.island + :where(.grid) { margin-top: var(--space-6); }

/* The goalkeeper choices (GoalieChoices.svelte): when to pull him, as stops
   on a clock of the last minutes, the end of the match on the right; when
   the backup comes on, as a scale of the score from losing to leading. */
.goalie { display: grid; gap: var(--space-2); }
.goalie .field-label { margin-top: var(--space-3); }
.goalie .field-label:first-child { margin-top: 0; }
.goalie-now { margin: 0; font-weight: 500; }
.clock { display: flex; align-items: center; gap: var(--space-3); }
.clock-track { position: relative; flex: 1 1 auto; height: 48px; min-width: 0; }
.clock-line {
  position: absolute; left: 0; right: 0; top: 50%; height: 4px; translate: 0 -50%;
  border-radius: var(--radius-full); background: var(--md-surface-container-highest);
}
.clock-pulled {
  position: absolute; right: 0; top: 50%; height: 8px; translate: 0 -50%; border-radius: var(--radius-full);
  background: repeating-linear-gradient(135deg, var(--md-error) 0 6px, var(--md-error-container) 6px 12px);
}
.clock-stop {
  position: absolute; top: 50%; translate: -50% -50%; display: flex; align-items: center; justify-content: center;
  min-width: 48px; height: 28px; padding: 0 var(--space-2); border: 1px solid var(--md-outline); border-radius: var(--radius-full);
  background: var(--md-surface); color: var(--md-on-surface); font: 500 12px/16px var(--font-sans); cursor: pointer;
}
.clock-stop:hover { background: var(--md-surface-container-high); }
.clock-stop.on { border-color: transparent; background: var(--md-error); color: var(--md-surface); }
.clock-stop:focus-visible, .scale-step:focus-visible { outline: 2px solid var(--md-primary); outline-offset: 2px; }
.clock-end {
  position: absolute; right: 0; top: 100%; translate: 0 -100%; font-size: 11px; line-height: 16px;
  color: var(--md-on-surface-variant); white-space: nowrap;
}
.score-scale { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.scale-end { font-size: 12px; color: var(--md-on-surface-variant); }
.scale { display: flex; flex-wrap: wrap; border: 1px solid var(--md-outline); border-radius: var(--radius-full); overflow: hidden; }
.scale-step {
  min-width: 36px; height: var(--control-height); padding: 0 var(--space-2); border: 0;
  background: transparent; color: var(--md-on-surface); font: 500 13px/20px var(--font-sans); cursor: pointer;
}
.scale-step + .scale-step { border-left: 1px solid var(--md-outline-variant); }
.scale-step.losing { background: color-mix(in srgb, var(--md-error-container) 45%, transparent); }
.scale-step.leading { background: color-mix(in srgb, var(--md-primary-container) 45%, transparent); }
.scale-step.never { padding: 0 var(--space-3); }
.scale-step:hover { filter: brightness(0.95); }
.scale-step.on.losing { background: var(--md-error); color: var(--md-surface); }
.scale-step.on.leading { background: var(--md-primary); color: var(--md-on-primary); }
.scale-step.on.never { background: var(--md-secondary-container); color: var(--md-on-secondary-container); }

/* The facilities (Facilities.svelte): a drawing that grows with the level
   beside a bar for every level, the club's filled in its colour and the one
   being built striped. */
.facilities .fac { display: grid; gap: var(--space-2); }
.facilities .fac p { margin: 0; }
.fac-head { display: flex; align-items: center; gap: var(--space-2); }
.fac-head h3 { margin: 0; }
.fac-soon-chip { border-style: dashed; }
.fac-body { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: var(--space-4); align-items: end; }
@media (max-width: 560px) { .fac-body { grid-template-columns: minmax(0, 1fr); } }
.fac-art { display: block; width: 100%; max-width: 220px; height: auto; }
.fac-ground { fill: var(--md-surface-container-high); }
.fac-stand { fill: var(--md-surface-container-highest); stroke: var(--md-outline-variant); stroke-width: 0.8; }
.fac-stand.lit { fill: var(--md-primary); stroke: none; }
.fac-stand.soon { fill: none; stroke: var(--md-primary); stroke-width: 1.2; stroke-dasharray: 3 2; }
.fac-floor, .fac-pitch { fill: var(--md-primary-container); stroke: var(--md-outline); stroke-width: 0.8; }
.fac-mark { stroke: var(--md-outline); stroke-width: 0.8; }
.fac-window { fill: var(--md-surface-container); opacity: 0.6; }
.fac-window.lit { fill: var(--md-on-primary); opacity: 0.8; }
.fac-roof { fill: var(--md-outline); }
.fac-ladder { display: grid; gap: var(--space-1); }
.fac-measure { font-size: 12px; color: var(--md-on-surface-variant); }
.fac-bars { display: flex; align-items: flex-end; gap: var(--space-1); height: 96px; }
.fac-bar { position: relative; flex: 1 1 0; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.fac-fill { display: block; border-radius: var(--radius-xs) var(--radius-xs) 0 0; background: var(--md-surface-container-highest); }
.fac-bar.mine .fac-fill { background: var(--md-primary); opacity: 0.55; }
.fac-bar.current .fac-fill { opacity: 1; }
.fac-bar.soon .fac-fill {
  background: repeating-linear-gradient(135deg, var(--md-primary) 0 4px, transparent 4px 8px);
  outline: 1px dashed var(--md-primary);
}
.fac-n { padding-top: var(--space-1); font-size: 11px; line-height: 16px; text-align: center; color: var(--md-on-surface-variant); }
.fac-value {
  position: absolute; bottom: 100%; left: 50%; translate: -50% 0; padding-bottom: calc(var(--space-1) / 2);
  font-size: 11px; font-weight: 500; white-space: nowrap;
}
.fac-bars { margin-top: var(--space-4); }
.fac-note { padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); background: var(--md-surface-container-high); }
.fac-ask { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: 0; }
.fac-ask span { font-weight: 500; }

/* The training week (TrainingWeek.svelte): the kinds of session as chips,
   each with a colour of its own, and the seven days as tiles in those
   colours; a match day is struck through with what it skips. */
.tw .chips { margin-bottom: var(--space-1); }
.tw-kind { gap: var(--space-2); cursor: grab; }
.tw-swatch { flex: none; width: 12px; height: 12px; border-radius: var(--radius-xs); background: var(--kind, var(--md-surface-container-highest)); border: 1px solid var(--kind-edge, transparent); }
.kind-attack { --kind: var(--md-primary-container); --kind-ink: var(--md-on-primary-container); }
.kind-defence { --kind: var(--md-secondary-container); --kind-ink: var(--md-on-secondary-container); }
.kind-physical { --kind: var(--md-tertiary-container); --kind-ink: var(--md-on-tertiary-container); }
.kind-tactics { --kind: var(--md-surface-container-highest); --kind-ink: var(--md-on-surface); --kind-edge: var(--md-outline); }
.kind-goalkeeping { --kind: var(--md-surface-container-high); --kind-ink: var(--md-on-surface); --kind-edge: var(--md-primary); }
.kind-rest { --kind: transparent; --kind-ink: var(--md-on-surface-variant); --kind-edge: var(--md-outline); }
.tw-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
@media (max-width: 720px) { .tw-week { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); } }
.tw-session { overflow-wrap: anywhere; }
.tw-day {
  display: grid; align-content: start; gap: var(--space-1); width: 100%; min-height: 88px; padding: var(--space-2) var(--space-3);
  border: 1px solid var(--kind-edge, transparent); border-radius: var(--radius-md); background: var(--kind); color: var(--kind-ink);
  font: 400 14px/20px var(--font-sans); text-align: left; cursor: pointer;
}
.kind-rest.tw-day { border-style: dashed; }
.tw-day:hover { filter: brightness(0.97); }
.tw-day:focus-visible { outline: 2px solid var(--md-primary); outline-offset: 2px; }
.tw-day.picked { outline: 3px solid var(--md-primary); outline-offset: 2px; }
.tw-day.over { outline: 2px dashed var(--md-primary); outline-offset: 2px; }
.tw-name { font: 500 12px/16px var(--font-sans); text-transform: uppercase; opacity: 0.8; }
.tw-session { font-weight: 500; }
.tw-day.match .tw-session { text-decoration: line-through; opacity: 0.6; }
.tw-match {
  justify-self: start; padding: 0 var(--space-1); border-radius: var(--radius-xs);
  background: var(--md-tertiary-container); color: var(--md-on-tertiary-container); font-size: 11px; line-height: 16px;
}
.tw-effects { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.tw-risk { margin: 0; padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); background: var(--md-error-container); color: var(--md-on-error-container); }
.tw-trains { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: var(--space-1) var(--space-6); margin: 0; padding: 0; list-style: none; }
.tw-trains li { display: grid; grid-template-columns: 112px minmax(0, 1fr) 28px; align-items: center; gap: var(--space-2); font-size: 13px; }
.tw-trains li.none { color: var(--md-on-surface-variant); }
.tw-attr { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tw-bar { height: 8px; border-radius: var(--radius-full); background: var(--md-surface-container-highest); overflow: hidden; }
.tw-bar span { display: block; height: 100%; border-radius: inherit; background: var(--md-primary); transition: width 0.3s ease; }
@media (prefers-reduced-motion: reduce) { .tw-bar span { transition: none; } }
.tw-trains b { text-align: right; font-weight: 500; }
.tw-note { margin: 0; }
.tw-note.loss { color: var(--md-error); }
.tw-energy, .tw-date, .tw-invited { font-size: 12px; line-height: 16px; opacity: 0.8; }
.tw-match { overflow-wrap: anywhere; }
.tw-tomorrow { font-size: 12px; line-height: 16px; }
.tw-day.next { box-shadow: inset 0 0 0 2px var(--md-primary); }
.tw-explain {
  display: grid; gap: var(--space-1); padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm);
  background: var(--md-surface-container-high); font-size: 13px; line-height: 20px;
}
.tw-split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--space-4) var(--space-6); }
@media (max-width: 900px) { .tw-split { grid-template-columns: minmax(0, 1fr); } }
.tw-split .tw-trains { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.tw-group { margin: 0 0 var(--space-2); font: 500 12px/16px var(--font-sans); color: var(--md-on-surface-variant); text-transform: uppercase; }
.tw-bar.keeper span { background: var(--md-on-surface-variant); }
.tw-split .tw-note { margin-top: var(--space-2); }

/* The rules the full upgrade changes: the rule's path and two values as
   code, a long value folded into a disclosure. */
.rules-diff td { vertical-align: top; }
.rules-diff code { overflow-wrap: anywhere; }
.rules-diff details code { display: block; margin-top: var(--space-1); }
.rules-diff summary { cursor: pointer; }

/* The played match (play.templ, PlayMatch.svelte): the whole window, the
   scoreboard on top, the rink lying as the floor does so the manager's side
   attacks to the right (whole in a wide window, under a camera that pans
   along it in a narrower one), the strip of the manager's five under it,
   and a card over a scrim before kickoff, in the pause and at the end. The dots are the replay's, in the club colours of --home (the
   manager's side) and --away. */
.play-body { margin: 0; height: 100vh; overflow: hidden; background: var(--md-surface-container-high); }
.play { height: 100%; }
.play-plain { display: grid; gap: var(--space-4); justify-items: center; padding: var(--space-6); }
.pm { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100vh; }
.pm-board {
  display: flex; align-items: center; justify-content: center; gap: var(--space-4);
  padding: var(--space-2) var(--space-6); background: var(--md-app-bar); color: var(--md-on-app-bar);
}
.pm-board .btn { color: var(--md-on-app-bar); }
.pm-team { font: 500 16px/24px var(--font-sans); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-team::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: var(--space-2); border-radius: var(--radius-full); background: var(--home); vertical-align: -1px; }
.pm-team.away::before { background: var(--away); }
.pm-score { font: 700 28px/36px var(--font-sans); font-variant-numeric: tabular-nums; }
.pm-pen { padding: 0 var(--space-2); border-radius: var(--radius-full); background: var(--md-error-container); color: var(--md-on-error-container); font: 500 14px/20px var(--font-mono); }
.pm-clock { font: 500 14px/20px var(--font-mono); color: var(--md-on-app-bar); opacity: 0.85; }
.pm-stage { position: relative; overflow: hidden; background: var(--pm-hall); }
/* The play rink (docs/DESIGN_SYSTEM.md, "Play rink"): the court, its
   lines, the boards with their shadow and the sides' stripes, the goals. */
.pr { --pr-floor: var(--pm-floor-blue); display: inline; overflow: visible; }
.pr.grey { --pr-floor: var(--pm-floor-grey); }
.pr-floor { fill: var(--pr-floor); }
.pr-tile { fill: none; stroke: var(--pm-floor-light); stroke-width: 0.3; opacity: 0.05; }
.pr-light-in { stop-color: var(--pm-floor-light); stop-opacity: 0.1; }
.pr-light-out { stop-color: var(--pm-floor-light); stop-opacity: 0; }
.pr-lines line, .pr-lines rect { fill: none; stroke: var(--pm-line); stroke-width: 1; }
.pr-lines .pr-area { fill: var(--pm-line); fill-opacity: 0.06; }
.pr-spot { fill: var(--pm-line); }
.pr-shadow { fill: none; stroke: var(--pm-shadow); stroke-width: 3.5; }
.pr-board-shadow { fill: var(--pm-shadow); }
.pr-board-edge, .pr-board { fill: none; }
.pr-board-edge { stroke: var(--pm-ink); stroke-width: 9; }
.pr-board { stroke: var(--pm-board); stroke-width: 8; }
.pr-stripe { fill: none; stroke-width: 1.6; }
.pr-stripe.home { stroke: var(--home); }
.pr-stripe.away { stroke: var(--away); }
.pr-goal-shadow { fill: var(--pm-shadow); }
.pr-mesh-base { fill: var(--pm-net); opacity: 0.22; }
.pr-mesh { stroke: var(--pm-net); stroke-width: 0.28; }
.pr-frame-edge, .pr-frame, .pr-bar-edge, .pr-bar { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.pr-frame-edge { stroke: var(--pm-ink); stroke-width: 1.9; }
.pr-frame { stroke: var(--pm-goal); stroke-width: 1.2; }
.pr-bar-edge { stroke: var(--pm-ink); stroke-width: 2.3; }
.pr-bar { stroke: var(--pm-goal); stroke-width: 1.5; }
.pr-goal.bulge .pr-net { animation: pr-bulge 0.8s ease-out; }
@keyframes pr-bulge {
  25% { d: path("M0 -8 H-5 Q-10 -6 -11.5 0 V0 Q-10 6 -5 8 H0 Z"); }
  50% { d: path("M0 -8 H-5 Q-7 -8 -7.5 -4 V4 Q-7 8 -5 8 H0 Z"); }
  70% { d: path("M0 -8 H-5 Q-8.5 -7 -9 -1 V1 Q-8.5 7 -5 8 H0 Z"); }
}
.pm-rink { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* The figures (play/Figure.svelte): a shadow, shoulders and arms in the
   club's colour edged in its ink and shaded on the back, skin, hair, the
   stick in ink with a blade of the player's colour, his shoes; a
   goalkeeper's shirt neutral, edged in the club's colour, with a mask,
   pads and gloves. The number stays upright. */
.pm-fig { --kit: var(--home); --kit-ink: var(--home-ink); --kit-edge: color-mix(in srgb, var(--kit) 45%, var(--pm-ink)); }
.pm-dot.away .pm-fig { --kit: var(--away); --kit-ink: var(--away-ink); }
.pm-fig .pm-shadow { fill: var(--pm-shadow); }
.pm-fig .pm-body { fill: var(--kit); stroke: var(--kit-edge); stroke-width: 0.45; }
.pm-fig .pm-shade { fill: color-mix(in srgb, var(--kit) 72%, var(--pm-ink)); }
.pm-fig .pm-sleeve, .pm-fig .pm-arm { fill: none; stroke-linecap: round; }
.pm-fig .pm-sleeve { stroke: var(--kit-edge); stroke-width: 1.9; }
.pm-fig .pm-arm { stroke: var(--kit); stroke-width: 1.2; }
.pm-fig .pm-hand, .pm-fig .pm-head { fill: var(--skin); stroke: var(--pm-ink); stroke-width: 0.25; }
.pm-fig .pm-hair { fill: var(--hair); stroke: var(--pm-ink); stroke-width: 0.25; }
.pm-fig .pm-band { fill: none; stroke: var(--pm-gear-white); stroke-width: 0.6; }
.pm-fig .pm-shoe { fill: var(--shoe); stroke: var(--pm-ink); stroke-width: 0.3; }
.pm-fig .pm-stick { fill: none; stroke: var(--pm-ink); stroke-width: 0.75; stroke-linecap: round; }
.pm-fig .pm-blade-edge, .pm-fig .pm-blade { fill: none; stroke-linecap: round; }
.pm-fig .pm-blade-edge { stroke: var(--pm-ink); stroke-width: 1.9; }
.pm-fig .pm-blade { stroke: var(--blade); stroke-width: 1.2; }
.pm-fig.keeper .pm-body { fill: var(--md-surface-container-highest); stroke: var(--kit); stroke-width: 0.9; }
.pm-fig.keeper .pm-sleeve { stroke: var(--kit); stroke-width: 2.4; }
.pm-fig.keeper .pm-arm { stroke: var(--md-surface-container-highest); stroke-width: 1.7; }
.pm-fig .pm-glove { fill: var(--glove); stroke: var(--pm-ink); stroke-width: 0.35; }
.pm-fig .pm-pad, .pm-fig .pm-mask { fill: var(--pm-gear-white); stroke: var(--pm-ink); stroke-width: 0.35; }
.pm-fig .pm-cage { fill: none; stroke: var(--pm-ink); stroke-width: 0.3; }
.pm-fig text { font: 700 3px var(--font-sans); text-anchor: middle; fill: var(--kit-ink); paint-order: stroke; stroke: var(--kit); stroke-width: 0.7; pointer-events: none; }
.pm-fig.keeper text { fill: var(--md-on-surface); stroke: var(--md-surface-container-highest); }
.pm-dot.block .pm-fig .pm-body { stroke: var(--md-error); stroke-width: 1.2; }
.pm-dot.leaving { opacity: 0.55; }
.pm-power { fill: none; stroke: var(--md-primary); stroke-width: 2.5; stroke-linecap: round; }
.pm-aim { stroke: var(--md-primary); stroke-width: 1; stroke-dasharray: 2 2; opacity: 0.6; }
.pm-chevron { fill: none; stroke: var(--md-primary); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.pm-ring { fill: none; stroke: var(--md-primary); stroke-width: 1.5; }
.pm-ball { fill: var(--md-surface); stroke: var(--md-on-surface); stroke-width: 0.8; }
.pm-tag text { font: 500 5px var(--font-sans); text-anchor: middle; fill: var(--md-on-surface); paint-order: stroke; stroke: var(--md-surface); stroke-width: 1.5; }
.pm-energy-bg { fill: var(--md-outline-variant); }
.pm-energy { fill: var(--md-primary); }
.pm-strip {
  display: flex; align-items: center; gap: var(--space-6); min-height: 48px; min-width: 0;
  padding: var(--space-2) var(--space-6); background: var(--md-surface); box-shadow: 0 -1px 0 var(--md-outline-variant);
}
.pm-strip h2 { margin: 0; flex: none; font: 500 14px/20px var(--font-sans); }
.pm-strip p { margin: 0; flex: none; font-size: 13px; line-height: 18px; color: var(--md-on-surface-variant); }
.pm-strip ul { margin: 0; padding: 0; list-style: none; display: flex; gap: var(--space-6); min-width: 0; flex: 1; }
.pm-strip li { display: grid; grid-template-columns: auto minmax(0, auto) 48px; align-items: center; gap: var(--space-2); min-width: 0; flex: 0 1 auto; font-size: 13px; line-height: 18px; }
.pm-strip li.leaving { opacity: 0.45; }
.pm-num { font-weight: 700; text-align: right; }
.pm-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-bar { height: 6px; border-radius: var(--radius-full); background: var(--md-outline-variant); overflow: hidden; }
.pm-bar span { display: block; height: 100%; background: var(--md-primary); }
.pm-strip li.low .pm-bar span { background: var(--md-error); }
.pm-hint {
  position: absolute; left: 50%; top: var(--space-6); transform: translateX(-50%); margin: 0;
  padding: var(--space-2) var(--space-4); border-radius: var(--radius-full);
  background: var(--md-surface); color: var(--md-on-surface); box-shadow: 0 0 0 1px var(--md-outline-variant);
}
.pm-trail { fill: none; stroke: var(--md-on-surface); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; opacity: 0.3; }
/* what the game does to a figure: the spin's shield ring and the burst's
   speed lines, a fallen player's stars, a stumble, and the ball lifted
   onto the blade for a zorro, its shadow and a ring on the floor under it */
.pm-shield { fill: none; stroke: var(--pm-line); stroke-width: 1; stroke-dasharray: 3 2.4; opacity: 0.85; }
.pm-speed { fill: none; stroke: var(--pm-line); stroke-width: 1; stroke-linecap: round; opacity: 0.7; }
.pm-star { fill: var(--pm-gear-yellow); stroke: var(--pm-ink); stroke-width: 0.25; }
.pm-stars { transform-box: fill-box; transform-origin: center; animation: spin 0.9s linear infinite; }
.pm-stumble { transform-box: fill-box; transform-origin: center; animation: pm-stumble 0.3s ease-in-out infinite alternate; }
@keyframes pm-stumble { from { transform: rotate(-12deg); } to { transform: rotate(12deg); } }
.pm-ball-shadow { fill: var(--pm-shadow); }
.pm-air { fill: none; stroke: var(--pm-line); stroke-width: 0.5; stroke-dasharray: 1.2 0.9; }
.pm-figs-floor { fill: var(--pm-floor-blue); }
@media (prefers-reduced-motion: reduce) { .pm-stars, .pm-stumble { animation: none; } }
/* a goal: the net it went into bulges while the banner shows (.pr-goal
   below), then the replay runs under a blinking heading */
.pm-replay {
  position: absolute; top: var(--space-6); left: 50%; translate: -50% 0; margin: 0;
  padding: var(--space-1) var(--space-4); border-radius: var(--radius-full);
  background: var(--md-error); color: var(--md-on-primary); font: 700 20px/28px var(--font-sans);
  letter-spacing: 0.15em; text-transform: uppercase; animation: pm-blink 1s steps(2, jump-none) infinite;
}
@keyframes pm-blink { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .pr-goal.bulge .pr-net, .pm-replay { animation: none; } }
.pm-banner {
  position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); width: min(calc(100% - 2 * var(--space-4)), var(--column-settings));
  display: grid; gap: var(--space-1); padding: var(--space-4) var(--space-6); border-radius: var(--radius-lg); text-align: center;
  background: var(--md-surface); color: var(--md-on-surface); box-shadow: 0 0 0 1px var(--md-outline-variant);
}
.pm-banner p { margin: 0; }
.pm-banner-title { font: 700 24px/32px var(--font-sans); color: var(--md-primary); }
.pm-foul .pm-ring { stroke: var(--md-error); stroke-width: 2; }
.pm-overlay { position: absolute; inset: 0; display: grid; place-items: center; padding: var(--space-6); background: var(--md-scrim); overflow: auto; }
.pm-card { width: min(100%, var(--column-settings)); gap: var(--space-4); }
.pm-card h1 { margin: 0; }
.pm-card h2 { margin: 0; font: 500 16px/24px var(--font-sans); }
.pm-card label { display: grid; gap: var(--space-1); }
.pm-keys { margin: 0; padding-left: var(--space-6); display: grid; gap: var(--space-1); }
.pm-final { margin: 0; font: 700 24px/32px var(--font-sans); }
.pm-card .actions { display: flex; justify-content: flex-end; gap: var(--space-2); }
/* The style guide shows the parts in a box of their own. */
.pm-sample { display: grid; border-radius: var(--radius-md); overflow: hidden; background: var(--md-surface-container-high); }
.pm-sample .pm-stage { min-height: 360px; }
.pm-figs { display: block; width: 100%; height: auto; background: var(--md-surface-container-low); }
.pr-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--column-form)), 1fr)); }
.pr-pair .pm-figs { background: var(--pm-hall); }
