@import url("/assets/lexxy-content-6b202f47.css");
@import url("/assets/lexxy-editor-17a82b29.css");

lexxy-editor,
.lexxy-content {
  --lexxy-color-canvas: var(--bg-bright);
  --lexxy-color-text: var(--text-bright);
  --lexxy-color-text-subtle: var(--text-color);
  --lexxy-color-ink: var(--text-bright);
  --lexxy-color-ink-medium: var(--text-color);
  --lexxy-color-ink-light: var(--text-muted);
  --lexxy-color-ink-lighter: var(--border-grayer);
  --lexxy-color-ink-lightest: var(--bg-gray);
  --lexxy-color-ink-inverted: var(--text-on-color-primary);

  --lexxy-color-link: var(--color-primary);
  --lexxy-color-accent-dark: var(--color-primary-dark);
  --lexxy-color-accent-medium: var(--color-primary);
  --lexxy-color-accent-light: var(--color-primary-faint);
  --lexxy-color-accent-lightest: var(--color-primary-faint);

  --lexxy-color-selected: var(--color-primary-faint);
  --lexxy-color-selected-hover: var(--color-primary-faint);
  --lexxy-color-selected-dark: var(--color-primary);

  --lexxy-color-code-bg: var(--bg-grayer);
  --lexxy-color-table-header-bg: var(--bg-gray);
  --lexxy-color-table-cell-border: var(--border-gray);
  --lexxy-color-table-cell-selected: var(--color-primary-faint);
  --lexxy-color-table-cell-selected-border: var(--color-primary);
  --lexxy-color-table-cell-selected-bg: var(--color-primary-faint);

  --lexxy-focus-ring-color: var(--color-primary);
  --lexxy-shadow: 0 2px 8px var(--shadow-color-a);
}

/* Trusted editor highlight variables become classes so arbitrary inline styles stay blocked. */
/*
  Rich text also renders outside .lexxy-content (articles, descriptions),
  where the browser's own yellow <mark> would show through: a colored mark
  starts from the surrounding text, and its classes add the color.
*/
:where(
  mark:is(
    [class*="lexxy-content__color-"],
    [class*="lexxy-content__highlight-"]
  )
) {
  background-color: transparent;
  color: inherit;
}

.lexxy-content__highlight-1 {
  background-color: var(--highlight-bg-1);
}
.lexxy-content__highlight-2 {
  background-color: var(--highlight-bg-2);
}
.lexxy-content__highlight-3 {
  background-color: var(--highlight-bg-3);
}
.lexxy-content__highlight-4 {
  background-color: var(--highlight-bg-4);
}
.lexxy-content__highlight-5 {
  background-color: var(--highlight-bg-5);
}
.lexxy-content__highlight-6 {
  background-color: var(--highlight-bg-6);
}
.lexxy-content__highlight-7 {
  background-color: var(--highlight-bg-7);
}
.lexxy-content__highlight-8 {
  background-color: var(--highlight-bg-8);
}
.lexxy-content__highlight-9 {
  background-color: var(--highlight-bg-9);
}
.lexxy-content__color-1 {
  color: var(--highlight-1);
}
.lexxy-content__color-2 {
  color: var(--highlight-2);
}
.lexxy-content__color-3 {
  color: var(--highlight-3);
}
.lexxy-content__color-4 {
  color: var(--highlight-4);
}
.lexxy-content__color-5 {
  color: var(--highlight-5);
}
.lexxy-content__color-6 {
  color: var(--highlight-6);
}
.lexxy-content__color-7 {
  color: var(--highlight-7);
}
.lexxy-content__color-8 {
  color: var(--highlight-8);
}
.lexxy-content__color-9 {
  color: var(--highlight-9);
}

/*
  The editor's color menu, readable wherever it lands: every text color
  stays at least 4.5:1 on every background color, on light pages and dark
  ones. Light values are checked over #fff, #f8fafc, #f7f3ea (Bulletin),
  #fbfaf7 (Clubhouse) and #f0f0f0 (Rec's darkest tint); dark values over
  #0f172a and #0b1220. Club styles with a dark ground force the dark
  scheme. The editor and the page read the same variables, so what a manager
  picks is what players see. Follows the app's scheme rules in
  _color_variables.css; print stays light. The widget repeats these in
  widget/_custom.css because its shadow root does not inherit :root.
*/
:root {
  --highlight-1: #685a1d;
  --highlight-2: #8f4805;
  --highlight-3: #ba0000;
  --highlight-4: #a61684;
  --highlight-5: #7f11e0;
  --highlight-6: #055bac;
  --highlight-7: #0d6a0c;
  --highlight-8: #884b15;
  --highlight-9: #5b5b5b;
  --highlight-bg-1: rgba(229, 223, 6, 0.3);
  --highlight-bg-2: rgba(255, 185, 87, 0.3);
  --highlight-bg-3: rgba(255, 118, 118, 0.3);
  --highlight-bg-4: rgba(248, 137, 216, 0.3);
  --highlight-bg-5: rgba(190, 165, 255, 0.3);
  --highlight-bg-6: rgba(124, 192, 252, 0.3);
  --highlight-bg-7: rgba(140, 255, 129, 0.3);
  --highlight-bg-8: rgba(221, 170, 123, 0.3);
  --highlight-bg-9: rgba(200, 200, 200, 0.3);

  @media (prefers-color-scheme: dark) {
    --highlight-1: #e2c541;
    --highlight-2: #fb923c;
    --highlight-3: #f87171;
    --highlight-4: #f472b6;
    --highlight-5: #c084fc;
    --highlight-6: #60a5fa;
    --highlight-7: #4ade80;
    --highlight-8: #d6a473;
    --highlight-9: #a1a1aa;
    --highlight-bg-1: rgba(229, 223, 6, 0.13);
    --highlight-bg-2: rgba(255, 185, 87, 0.13);
    --highlight-bg-3: rgba(255, 118, 118, 0.13);
    --highlight-bg-4: rgba(248, 137, 216, 0.13);
    --highlight-bg-5: rgba(190, 165, 255, 0.13);
    --highlight-bg-6: rgba(124, 192, 252, 0.13);
    --highlight-bg-7: rgba(140, 255, 129, 0.13);
    --highlight-bg-8: rgba(221, 170, 123, 0.13);
    --highlight-bg-9: rgba(200, 200, 200, 0.13);
  }
}

body[data-color-scheme="dark"] {
  --highlight-1: #e2c541;
  --highlight-2: #fb923c;
  --highlight-3: #f87171;
  --highlight-4: #f472b6;
  --highlight-5: #c084fc;
  --highlight-6: #60a5fa;
  --highlight-7: #4ade80;
  --highlight-8: #d6a473;
  --highlight-9: #a1a1aa;
  --highlight-bg-1: rgba(229, 223, 6, 0.13);
  --highlight-bg-2: rgba(255, 185, 87, 0.13);
  --highlight-bg-3: rgba(255, 118, 118, 0.13);
  --highlight-bg-4: rgba(248, 137, 216, 0.13);
  --highlight-bg-5: rgba(190, 165, 255, 0.13);
  --highlight-bg-6: rgba(124, 192, 252, 0.13);
  --highlight-bg-7: rgba(140, 255, 129, 0.13);
  --highlight-bg-8: rgba(221, 170, 123, 0.13);
  --highlight-bg-9: rgba(200, 200, 200, 0.13);
}

body[data-color-scheme="light"] {
  --highlight-1: #685a1d;
  --highlight-2: #8f4805;
  --highlight-3: #ba0000;
  --highlight-4: #a61684;
  --highlight-5: #7f11e0;
  --highlight-6: #055bac;
  --highlight-7: #0d6a0c;
  --highlight-8: #884b15;
  --highlight-9: #5b5b5b;
  --highlight-bg-1: rgba(229, 223, 6, 0.3);
  --highlight-bg-2: rgba(255, 185, 87, 0.3);
  --highlight-bg-3: rgba(255, 118, 118, 0.3);
  --highlight-bg-4: rgba(248, 137, 216, 0.3);
  --highlight-bg-5: rgba(190, 165, 255, 0.3);
  --highlight-bg-6: rgba(124, 192, 252, 0.3);
  --highlight-bg-7: rgba(140, 255, 129, 0.3);
  --highlight-bg-8: rgba(221, 170, 123, 0.3);
  --highlight-bg-9: rgba(200, 200, 200, 0.3);
}

@media print {
  :root,
  body[data-color-scheme] {
    --highlight-1: #685a1d;
    --highlight-2: #8f4805;
    --highlight-3: #ba0000;
    --highlight-4: #a61684;
    --highlight-5: #7f11e0;
    --highlight-6: #055bac;
    --highlight-7: #0d6a0c;
    --highlight-8: #884b15;
    --highlight-9: #5b5b5b;
    --highlight-bg-1: rgba(229, 223, 6, 0.3);
    --highlight-bg-2: rgba(255, 185, 87, 0.3);
    --highlight-bg-3: rgba(255, 118, 118, 0.3);
    --highlight-bg-4: rgba(248, 137, 216, 0.3);
    --highlight-bg-5: rgba(190, 165, 255, 0.3);
    --highlight-bg-6: rgba(124, 192, 252, 0.3);
    --highlight-bg-7: rgba(140, 255, 129, 0.3);
    --highlight-bg-8: rgba(221, 170, 123, 0.3);
    --highlight-bg-9: rgba(200, 200, 200, 0.3);
  }
}
