/* r42 Items 18–19. Games PAGE surfaces only. Load after the existing Games
   styles. The page runner is #library-main > .hub-toolbar, NOT a room HUD.
   Cyber, Azeroth and Agandar deliberately do not match these shape rules. */
body[data-ar-document="games"]:is([data-library-theme="full"],[data-library-theme="youth"],[data-library-theme="window"][data-window-theme="auriela"],[data-library-theme="window"][data-window-theme="solomon"]) #library-main > .hub-toolbar {
  border:1px solid var(--hub-line)!important;
  border-radius:24px;
  overflow:visible;
}
body[data-ar-document="games"][data-library-theme="full"] #library-main > .hub-toolbar {
  background:linear-gradient(145deg,#292929,#171717);
  box-shadow:inset 0 1px #ffffff18,0 8px 24px #0004;
}
/* The notched fabric is a noninteractive background only. Never clip the
   toolbar itself: rings, menus and hit targets must keep their full extent. */
body[data-ar-document="games"][data-library-theme="window"][data-window-theme="default"] #library-main > .hub-toolbar {
  position:relative;
  isolation:isolate;
  background:transparent!important;
  border:0!important;
  border-radius:0;
  padding-inline:32px!important;
  overflow:visible;
  box-shadow:none;
}
body[data-ar-document="games"][data-library-theme="window"][data-window-theme="default"] #library-main > .hub-toolbar::before {
  content:"";
  position:absolute;
  inset:0;
  z-index:-1;
  pointer-events:none;
  background:linear-gradient(180deg,#b8a172 0 2px,transparent 2px calc(100% - 2px),#b8a172 calc(100% - 2px)),linear-gradient(105deg,#49332d,#2d2523 45%,#49332d);
  clip-path:polygon(0 0,100% 0,calc(100% - 16px) 50%,100% 100%,0 100%,16px 50%);
}
/* Wrapping and the existing 44px icon controls stay intact. Category labels
   are never squeezed or truncated at 320px or after text enlargement. */
@media(max-width:700px) {
  body[data-ar-document="games"]:is([data-library-theme="full"],[data-library-theme="youth"],[data-library-theme="window"][data-window-theme="auriela"],[data-library-theme="window"][data-window-theme="solomon"],[data-library-theme="window"][data-window-theme="default"]) #library-main > .hub-toolbar {
    flex-wrap:wrap;
    gap:12px;
    padding-block:16px!important;
  }
  body[data-ar-document="games"]:is([data-library-theme="full"],[data-library-theme="youth"],[data-library-theme="window"][data-window-theme="auriela"],[data-library-theme="window"][data-window-theme="solomon"],[data-library-theme="window"][data-window-theme="default"]) #library-main > .hub-toolbar .hub-filters {
    flex-wrap:wrap;
    max-width:100%;
  }
  body[data-ar-document="games"][data-library-theme="window"][data-window-theme="default"] #library-main > .hub-toolbar {padding-inline:26px!important}
}
@media(max-width:380px) {
  body[data-ar-document="games"][data-library-theme="window"][data-window-theme="default"] #library-main > .hub-toolbar {padding-inline:22px!important}
}
@media(forced-colors:none) {
  /* Auriela: parchment, aged wood, muted rose and antique brass. Opaque
     reading surfaces keep contrast independent of the day/night painting.
     Opt out while a room is open, in high contrast, and in forced colors. */
  html:not([data-reading-contrast="high"]) body[data-ar-document="games"][data-library-theme="window"][data-window-theme="auriela"]:not(.sanctuary-open):not([data-reading-contrast="high"]) {
    --cottage42-paper:#efe0c6;
    --cottage42-paper-deep:#e5cfad;
    --cottage42-ink:#3f2b24;
    --cottage42-muted:#654b3e;
    --cottage42-rose:#785052;
    --cottage42-rose-dark:#624044;
    --cottage42-metal:#866441;
    --cottage42-light:#fff4df;
    --hub-panel:var(--cottage42-paper);
    --hub-ink:var(--cottage42-ink);
    --hub-muted:var(--cottage42-muted);
    --hub-silver:var(--cottage42-rose);
    --hub-bright:var(--cottage42-rose-dark);
    --hub-line:var(--cottage42-metal);
    --choice41-bg:var(--cottage42-paper);
    --choice41-tile:var(--cottage42-paper-deep);
    --choice41-ink:var(--cottage42-ink);
    --choice41-muted:var(--cottage42-muted);
    --choice41-accent:var(--cottage42-rose-dark);
    --choice41-line:var(--cottage42-metal);
    --choice41-button:var(--cottage42-paper-deep);
    --choice41-font:Georgia,serif;
    --choice41-error:#8b2929;
    scrollbar-color:var(--cottage42-rose) var(--cottage42-paper);
  }
  /* Only descendants of these page-owned surfaces receive the palette. */
  html:not([data-reading-contrast="high"]) body[data-ar-document="games"][data-window-theme="auriela"]:not(.sanctuary-open):not([data-reading-contrast="high"]) #library-main :is(.hub-intro,.hub-toolbar,.hub-section-heading,.hub-library-note,.hub-preference-notice) {
    background:linear-gradient(115deg,#fff8e355,transparent 60%),var(--cottage42-paper)!important;
    color:var(--cottage42-ink);
    border:1px solid var(--cottage42-metal)!important;
    box-shadow:inset 0 1px #fff4df,0 8px 24px #24180f33;
  }
  html:not([data-reading-contrast="high"]) body[data-ar-document="games"][data-window-theme="auriela"]:not(.sanctuary-open):not([data-reading-contrast="high"]) #library-main :is(.hub-feature,.hub-app-card) {
    background:var(--cottage42-paper);
    border-color:var(--cottage42-metal);
    box-shadow:0 12px 28px #24180f44;
  }
  html:not([data-reading-contrast="high"]) body[data-ar-document="games"][data-window-theme="auriela"]:not(.sanctuary-open):not([data-reading-contrast="high"]) #library-main :is(.hub-feature-copy,.hub-card-body) {
    background:linear-gradient(120deg,#fff8e330,transparent),var(--cottage42-paper);
    color:var(--cottage42-ink);
  }
  html:not([data-reading-contrast="high"]) body[data-ar-document="games"][data-window-theme="auriela"]:not(.sanctuary-open):not([data-reading-contrast="high"]) #library-main :is(.hub-intro h1,.hub-section-heading h2,.hub-feature-copy h3,.hub-card-body h3) {color:var(--cottage42-ink);text-shadow:none}
  html:not([data-reading-contrast="high"]) body[data-ar-document="games"][data-window-theme="auriela"]:not(.sanctuary-open):not([data-reading-contrast="high"]) #library-main :is(.hub-kicker,.hub-card-eyebrow,.hub-subtitle,.hub-section-heading span) {color:var(--cottage42-rose-dark);border-color:var(--cottage42-metal)}
  html:not([data-reading-contrast="high"]) body[data-ar-document="games"][data-window-theme="auriela"]:not(.sanctuary-open):not([data-reading-contrast="high"]) #library-main :is(.hub-count,.hub-play-note,.hub-card-bottom>span,.hub-library-note) {color:var(--cottage42-muted)}
  html:not([data-reading-contrast="high"]) body[data-ar-document="games"][data-window-theme="auriela"]:not(.sanctuary-open):not([data-reading-contrast="high"]) :is(#library-main .hub-mode-control,#library-main .hub-filter,#library-main .hub-cameo-controls button,#library-main .ar-games-music-transport button,#library-main .hub-explorer-link,#hub-theme-menu button,#ar-companion-menu button) {
    background:var(--cottage42-paper-deep)!important;
    color:var(--cottage42-ink)!important;
    border:1px solid var(--cottage42-metal);
    box-shadow:inset 0 1px #fff4df80;
  }
  html:not([data-reading-contrast="high"]) body[data-ar-document="games"][data-window-theme="auriela"]:not(.sanctuary-open):not([data-reading-contrast="high"]) #library-main :is(.hub-feature,.hub-app-card) .hub-play {
    background:var(--cottage42-rose);
    color:var(--cottage42-light);
    border-color:var(--cottage42-rose-dark);
    box-shadow:inset 0 1px #d8b0a955,0 3px 7px #3f2b2426;
  }
  html:not([data-reading-contrast="high"]) body[data-ar-document="games"][data-window-theme="auriela"]:not(.sanctuary-open):not([data-reading-contrast="high"]) #library-main :is(.hub-mode-control small,.hub-mode-control>span:last-child,.ar-games-music-transport) {color:var(--cottage42-muted)}
  html:not([data-reading-contrast="high"]) body[data-ar-document="games"][data-window-theme="auriela"]:not(.sanctuary-open):not([data-reading-contrast="high"]) :is(#hub-theme-menu,#ar-companion-menu) {
    background:var(--cottage42-paper);
    color:var(--cottage42-ink);
    border-color:var(--cottage42-metal);
    box-shadow:0 16px 44px #24180f66,inset 0 1px #fff4df;
    scrollbar-color:var(--cottage42-rose) var(--cottage42-paper);
  }
  html:not([data-reading-contrast="high"]) body[data-ar-document="games"][data-window-theme="auriela"]:not(.sanctuary-open):not([data-reading-contrast="high"]) :is(.hub-theme-menu-title,.ar-companion-menu-title,#ar-companion-menu .ar-companion-section) {color:var(--cottage42-muted);opacity:1}
  html:not([data-reading-contrast="high"]) body[data-ar-document="games"][data-window-theme="auriela"]:not(.sanctuary-open):not([data-reading-contrast="high"]) :is(#library-main .hub-filter,#library-main .hub-cameo-controls button,#library-main .ar-games-music-transport button,#hub-theme-menu button,#ar-companion-menu button):is([aria-pressed="true"],[aria-checked="true"]) {
    background:var(--cottage42-rose)!important;
    color:var(--cottage42-light)!important;
    border-color:var(--cottage42-rose-dark);
    box-shadow:inset 0 -3px var(--cottage42-rose-dark);
  }
  html:not([data-reading-contrast="high"]) body[data-ar-document="games"][data-window-theme="auriela"]:not(.sanctuary-open):not([data-reading-contrast="high"]) :is(#library-main button,#library-main .hub-explorer-link,#hub-theme-menu button,#ar-companion-menu button):not(:disabled):not([aria-disabled="true"]):hover {
    background:var(--cottage42-rose-dark)!important;
    color:var(--cottage42-light)!important;
    border-color:var(--cottage42-rose-dark);
  }
  html:not([data-reading-contrast="high"]) body[data-ar-document="games"][data-window-theme="auriela"]:not(.sanctuary-open):not([data-reading-contrast="high"]) :is(#library-main button,#library-main a,#hub-theme-menu button,#ar-companion-menu button):focus-visible {
    outline:3px solid var(--cottage42-rose-dark)!important;
    outline-offset:4px;
    box-shadow:0 0 0 2px var(--cottage42-light)!important;
  }
  html:not([data-reading-contrast="high"]) body[data-ar-document="games"][data-window-theme="auriela"]:not(.sanctuary-open):not([data-reading-contrast="high"]) #hub-theme-menu button[data-locked="true"] {color:var(--cottage42-muted)!important;opacity:1;filter:none}
  html:not([data-reading-contrast="high"]) body[data-ar-document="games"][data-window-theme="auriela"]:not(.sanctuary-open):not([data-reading-contrast="high"]) .hub-footer {background:#3f2b24;color:#efe0c6;border-color:#866441}
  html:not([data-reading-contrast="high"]) body[data-ar-document="games"][data-window-theme="auriela"]:not(.sanctuary-open):not([data-reading-contrast="high"]) .hub-footer a {color:#fff4df}
  html:not([data-reading-contrast="high"]) body[data-ar-document="games"][data-window-theme="auriela"]:not(.sanctuary-open):not([data-reading-contrast="high"]) #sanctuary-card:not([data-selection="unselected"]) > .sanctuary-card-copy {background:var(--cottage42-paper);color:var(--cottage42-ink)}
  html:not([data-reading-contrast="high"]) body[data-ar-document="games"][data-window-theme="auriela"]:not(.sanctuary-open):not([data-reading-contrast="high"]) #sanctuary-card:not([data-selection="unselected"]) > .sanctuary-card-copy :is(h2,h3,h4) {color:var(--cottage42-ink);text-shadow:none}
  html:not([data-reading-contrast="high"]) body[data-ar-document="games"][data-window-theme="auriela"]:not(.sanctuary-open):not([data-reading-contrast="high"]) #sanctuary-card:not([data-selection="unselected"]) > .sanctuary-card-copy :is(p,small) {color:var(--cottage42-muted)}
  html:not([data-reading-contrast="high"]) body[data-ar-document="games"][data-window-theme="auriela"]:not(.sanctuary-open):not([data-reading-contrast="high"]) #sanctuary-card:not([data-selection="unselected"]) > .sanctuary-card-copy .hub-play {background:var(--cottage42-rose);color:var(--cottage42-light);border-color:var(--cottage42-rose-dark)}
  html:not([data-reading-contrast="high"]) body[data-ar-document="games"][data-window-theme="auriela"]:not(.sanctuary-open):not([data-reading-contrast="high"]) #ar-companion-menu .ar-companion-menu-copy small {opacity:1}
  html:not([data-reading-contrast="high"]) body[data-ar-document="games"][data-window-theme="auriela"]:not(.sanctuary-open):not([data-reading-contrast="high"]) #library-main .hub-mode-control:hover :is(small,strong,span) {color:inherit}
  /* Root scrollbar matches the page too; the default blue native accent is
     not reintroduced in the page-owned theme/companion menus. */
  html:not([data-reading-contrast="high"]):has(> body[data-ar-document="games"][data-library-theme="window"][data-window-theme="auriela"]:not(.sanctuary-open):not([data-reading-contrast="high"])) {scrollbar-color:#785052 #efe0c6}
  html:not([data-reading-contrast="high"]) body[data-ar-document="games"][data-window-theme="auriela"]:not(.sanctuary-open):not([data-reading-contrast="high"]) :is(#hub-theme-menu,#ar-companion-menu)::-webkit-scrollbar {width:12px}
  html:not([data-reading-contrast="high"]) body[data-ar-document="games"][data-window-theme="auriela"]:not(.sanctuary-open):not([data-reading-contrast="high"]) :is(#hub-theme-menu,#ar-companion-menu)::-webkit-scrollbar-track {background:var(--cottage42-paper)}
  html:not([data-reading-contrast="high"]) body[data-ar-document="games"][data-window-theme="auriela"]:not(.sanctuary-open):not([data-reading-contrast="high"]) :is(#hub-theme-menu,#ar-companion-menu)::-webkit-scrollbar-thumb {background:var(--cottage42-rose);border:3px solid var(--cottage42-paper);border-radius:8px}
  /* Chapel runner: candlelit stone, aged brass and deep wine cloth. */
  html:not([data-reading-contrast="high"]) body[data-ar-document="games"][data-window-theme="default"]:not([data-reading-contrast="high"]) #library-main > .hub-toolbar {color:#f7edd9;--hub-silver:#e6d6b8;--hub-muted:#e6d6b8;--hub-bright:#fff3ce}
  html:not([data-reading-contrast="high"]) body[data-ar-document="games"][data-window-theme="default"]:not([data-reading-contrast="high"]) #library-main > .hub-toolbar :is(.hub-count,.ar-games-music-transport) {color:#e6d6b8}
  html:not([data-reading-contrast="high"]) body[data-ar-document="games"][data-window-theme="default"]:not([data-reading-contrast="high"]) #library-main > .hub-toolbar :is(.hub-filter,.hub-cameo-controls button,.ar-games-music-transport button) {background:#3c3028;color:#f7edd9;border:1px solid #b8a172;box-shadow:inset 0 1px #fff0cf19}
  html:not([data-reading-contrast="high"]) body[data-ar-document="games"][data-window-theme="default"]:not([data-reading-contrast="high"]) #library-main > .hub-toolbar button:is([aria-pressed="true"],[aria-checked="true"],:hover) {background:#e6d6b8;color:#30241f;border-color:#fff3ce;box-shadow:inset 0 -3px #b8a172}
  html:not([data-reading-contrast="high"]) body[data-ar-document="games"][data-window-theme="default"]:not([data-reading-contrast="high"]) #library-main > .hub-toolbar button:focus-visible {outline:3px solid #fff3ce;outline-offset:4px;box-shadow:0 0 0 2px #30241f}
}
/* Accessibility remains higher priority than decorative cloth. */
body[data-ar-document="games"][data-reading-contrast="high"]:is([data-library-theme="full"],[data-library-theme="youth"],[data-library-theme="window"][data-window-theme="auriela"],[data-library-theme="window"][data-window-theme="solomon"]) #library-main > .hub-toolbar {border-color:#fff!important;background:#080808!important;color:#fff!important}

body[data-ar-document="games"][data-window-theme="default"][data-reading-contrast="high"] #library-main > .hub-toolbar::before {background:#080808;border:1px solid #fff}
@media(forced-colors:active) {
  body[data-ar-document="games"]:is([data-library-theme="full"],[data-library-theme="youth"],[data-library-theme="window"][data-window-theme="auriela"],[data-library-theme="window"][data-window-theme="solomon"]) #library-main > .hub-toolbar {border-color:CanvasText!important;background:Canvas!important;color:CanvasText!important}
  body[data-ar-document="games"][data-library-theme="window"][data-window-theme="default"] #library-main > .hub-toolbar {background:Canvas!important;border:1px solid CanvasText!important}
  body[data-ar-document="games"][data-window-theme="default"] #library-main > .hub-toolbar::before {display:none}
}
