/* ============================================================
   The site header, Menu and footer on the Games page, /mara/games/ (26 Nov 2026)
   A copy of /tools/site-frame.css (the free tools, 25 Nov 2026) with one difference: the "fence" below leaves
   drawings (inline <svg>) alone. In Safari's engine, "all: revert" also wipes an SVG shape's own size and colour
   (for example <rect width fill>), so the small game icons on the cards came out blank. The rest is the same.
   ============================================================ */
@layer site, fence;
@import url("/styles.css") layer(site);

@layer fence {
  body > :not(nav, footer, .uo-panel, .uo-panel-scrim, .uo-pop-back, #backTop, script),
  body > :not(nav, footer, .uo-panel, .uo-panel-scrim, .uo-pop-back, #backTop, script) :not(svg, svg *),
  body > :not(nav, footer, .uo-panel, .uo-panel-scrim, .uo-pop-back, #backTop, script) :not(svg, svg *)::before,
  body > :not(nav, footer, .uo-panel, .uo-panel-scrim, .uo-pop-back, #backTop, script) :not(svg, svg *)::after {
    all: revert;
  }
  /* The line above also skips the browser's built-in meaning of the hidden attribute, so it is put back here. */
  body > [hidden]:not(nav, footer, .uo-panel, .uo-panel-scrim, .uo-pop-back, #backTop, script),
  body > :not(nav, footer, .uo-panel, .uo-panel-scrim, .uo-pop-back, #backTop, script) [hidden] {
    display: none;
  }
  /* What the tool's text took from the page body before: the tool's own body rule and colour names. */
  body > :not(nav, footer, .uo-panel, .uo-panel-scrim, .uo-pop-back, #backTop, script) {
    font-family: var(--sans); font-size: 17px; line-height: 1.6; color: var(--body); -webkit-font-smoothing: antialiased;
    --rose: #9D6462; --deep-rose: #7E4C4A; --soft-rose: #D8B3AE; --sage: #C8D1C2;
  }
  html[data-theme='dark'] body > :not(nav, footer, .uo-panel, .uo-panel-scrim, .uo-pop-back, #backTop, script) {
    --rose: #d3a09c; --deep-rose: #efc1bb; --soft-rose: #7a5754; --sage: #5d6859;
  }
}

/* The site's header, Menu panel, pop-up and footer take only the site's styles (the tool's rules are skipped).
   #backTop in the list also gives these rules the weight to beat any tool rule. */
:is(nav, footer, .uo-panel, .uo-panel-scrim, .uo-pop-back, #backTop),
:is(nav, footer, .uo-panel, .uo-panel-scrim, .uo-pop-back, #backTop) *,
:is(nav, footer, .uo-panel, .uo-panel-scrim, .uo-pop-back, #backTop) *::before,
:is(nav, footer, .uo-panel, .uo-panel-scrim, .uo-pop-back, #backTop) *::after,
:is(nav, footer, .uo-panel, .uo-panel-scrim, .uo-pop-back, #backTop) ::placeholder {
  all: revert-layer;
}
/* Four colour names are used by both the site and the tools with different dark-theme values; the page keeps the site's. */
html:root[data-theme], html:root {
  --rose: revert-layer; --deep-rose: revert-layer; --soft-rose: revert-layer; --sage: revert-layer;
}
@media screen {
  /* The page body takes the site's body styles on screen, so the header sticks to the top as on every other page
     (a tool's own body rule turns sideways scrolling off on the body, which stops a sticky header). */
  html > body { all: revert-layer; }
}
/* The site's faint paper texture over the whole screen is left off these pages, so the tool looks exactly as before. */
html > body::before { content: none; }

@media print {
  /* Printing or saving a result as a PDF prints the tool's result only, as before. */
  :is(nav, footer, .uo-panel, .uo-panel-scrim, .uo-pop-back, #backTop) { display: none !important; }
}
