/* Catalogue only; gameplay and the landing page keep their own palettes. */
body.arcade-site:has(.hangman-catalog) {
    background: radial-gradient(ellipse at 80% 0, #29465c 0, transparent 55%), #152231;
    color: #f4f7fa;
    --hc-surface: #f1f5f8;
    --hc-ink: #293845;
    --hc-muted: #596976;
    --hc-border: #c3cdd5;
    --hc-soft: #e4eaf0;
    --hc-active: #385974;
    --hc-card: #fcfcfc;
    --hc-card-hover: #ececec;
    --hc-card-ink: #353535;
    --hc-card-border: #d0d0d0;
}
body.arcade-site.dark-mode:has(.hangman-catalog) {
    --hc-surface: #152231;
    --hc-ink: #edf4fa;
    --hc-muted: #b4c5d2;
    --hc-border: #3e5569;
    --hc-soft: #22374a;
    --hc-active: #b5def4;
    --hc-card: #292d32;
    --hc-card-hover: #353a40;
    --hc-card-ink: #e1e1e1;
    --hc-card-border: #4b4f55;
}
body.arcade-site:has(.hangman-catalog) > header { display: block; background: #141e2a; border-color: #32485d; }
body.arcade-site .hangman-catalog.content { width: min(1200px, 92%); margin: 0 auto; padding: 0 0 32px; background: transparent; }
body.arcade-site .hangman-catalog h1 { text-align: start; }
.hangman-catalog .hangman-catalog-art { width: 180px; justify-self: end; transform: rotate(-5deg); }
.hangman-catalog-art svg { display: block; width: 100%; height: auto; border-radius: 10px; }
body.arcade-site .hangman-catalog .wordsearch-masthead { grid-template-columns: minmax(0, 1fr) 180px; }
.hangman-catalog .catalog-facts { margin-top: 18px; }
.hangman-catalog .hangman-catalog-results { position: relative; isolation: isolate; padding: 24px 0 8px; color: var(--hc-ink); }
.hangman-catalog-results::before { content: ''; position: absolute; z-index: -1; inset: 0; background: var(--hc-surface); box-shadow: 0 0 0 100vmax var(--hc-surface); clip-path: inset(0 -100vmax); pointer-events: none; }
.hangman-catalog .hangman-topics { gap: 8px; margin: 0 0 20px; }
body.arcade-site .hangman-catalog .hangman-topics button { display: inline-flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 100%; min-height: 42px; box-sizing: border-box; padding: 9px 12px; border: 1px solid transparent; border-radius: 8px; background: var(--hc-soft); color: var(--hc-ink); font: 500 13px/1.4 system-ui, sans-serif; text-align: start; box-shadow: none; text-shadow: none; }
.hangman-catalog .hangman-topics small { flex-shrink: 0; color: var(--hc-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
body.arcade-site .hangman-catalog .hangman-topics button[aria-pressed="true"] { background: var(--hc-active); color: #fff; border-color: transparent; }
body.arcade-site.dark-mode .hangman-catalog .hangman-topics button[aria-pressed="true"] { color: #173c55; }
.hangman-catalog .hangman-topics button[aria-pressed="true"] small { color: inherit; opacity: .85; }
.hangman-catalog #hangman-catalog-status { margin: 0 0 24px; color: var(--hc-muted); font-size: 13px; line-height: 1.5; }
body.arcade-site .hangman-catalog .hangman-topic { margin: 0 0 32px; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--hc-ink); }
.hangman-catalog .hangman-topic h2 { display: flex; align-items: center; gap: 12px; margin: 0 0 18px; padding-bottom: 14px; border-bottom: 1px solid var(--hc-border); color: var(--hc-ink); font-size: 24px; font-weight: 650; line-height: 1.35; }
body.arcade-site .hangman-catalog .hangman-topic-count { flex-shrink: 0; margin: 0; padding: 4px 9px; border-radius: 6px; background: var(--hc-soft); color: var(--hc-muted); font-size: 12px; font-weight: 500; }
.hangman-catalog .hangman-game-list { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
body.arcade-site .hangman-catalog .hangman-game-list a { display: flex; flex-direction: column; justify-content: center; align-items: center; position: relative; overflow: hidden; box-sizing: border-box; min-height: 106px; padding: 10px 6px; border: 1px solid var(--hc-card-border); border-radius: 10px; background: var(--hc-card); color: var(--hc-card-ink); box-shadow: 0 3px 0 #09131f14; transition: background .15s, border-color .15s, transform .15s; }
.hangman-catalog .hangman-catalog-number { font-size: 27px; font-weight: 750; line-height: 1.25; font-variant-numeric: tabular-nums; }
.hangman-catalog .hangman-game-status { min-height: 16px; max-width: 100%; font-size: 10px; line-height: 1.5; text-align: center; overflow-wrap: anywhere; }
.hangman-catalog .hangman-catalog-play { margin-top: 8px; font-size: 11px; font-weight: 400; line-height: 1.35; text-align: center; overflow-wrap: anywhere; }
body.arcade-site .hangman-catalog .hangman-game-list a.is-solved { background: var(--hc-card); border-color: var(--hc-card-border); color: var(--hc-card-ink); }
.hangman-catalog .hangman-game-list a.is-solved::before { content: ''; height: 16px; }
/* Match the diagonal completion stamp used in the word-search catalogue. */
body.arcade-site .hangman-catalog .hangman-game-list a.is-solved .hangman-game-status { position: absolute; z-index: 1; top: 50%; left: 50%; box-sizing: border-box; width: 94%; max-width: none; min-height: 0; margin: 0; padding: 5px 2px; border: 4px double #dc1212; border-radius: 4px; background: #f2f2f2; color: #dc1212; opacity: 1; font-size: 11px; font-weight: 700; line-height: 1.25; transform: translate(-50%, -50%) rotate(-35deg); pointer-events: none; }
.hangman-catalog .is-solved .hangman-game-status::before { content: '✓'; margin-inline-end: 4px; }
body.arcade-site .hangman-catalog :is(button, a):focus-visible { outline: 3px solid #8bb5ce; outline-offset: 3px; }
@media (hover: hover) {
    body.arcade-site .hangman-catalog .hangman-topics button:hover { border-color: var(--hc-border); }
    body.arcade-site .hangman-catalog .hangman-game-list a:hover { background: var(--hc-card-hover); border-color: #92979c; color: var(--hc-card-ink); transform: translateY(-2px); }
}
@media (max-width: 600px) {
    body.arcade-site .hangman-catalog .wordsearch-masthead { grid-template-columns: minmax(0, 1fr); }
    .hangman-catalog-art { display: none; }
    .hangman-catalog .hangman-catalog-results { padding-top: 20px; }
    .hangman-catalog .hangman-topics { gap: 6px; }
    body.arcade-site .hangman-catalog .hangman-topics button { gap: 8px; padding: 8px 10px; font-size: 12px; }
    .hangman-catalog .hangman-topic h2 { font-size: 21px; }
    .hangman-catalog .hangman-game-list { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
    .hangman-catalog .hangman-catalog-number { font-size: 25px; }
}
@media (prefers-reduced-motion: reduce) {
    body.arcade-site .hangman-catalog .hangman-game-list a { transition: none; transform: none; }
}
