/**
 * Copyright (c) 2025-2026 Let's Automate. All rights reserved.
 * This source code is proprietary and confidential.
 *
 * GAME SWITCHES: the hiding half, linked in <head> so it is in force before the
 * first paint and even on a visit where assets/js/game-switches.js never runs.
 *
 * It FAILS CLOSED. Copy about a switchable game is hidden unless <html> carries
 * lgg-on-<game>, and only game-switches.js puts that class there, after the
 * database (or the device's remembered answer) says the game is on. So a crawler,
 * a blocked script or a failed read all see the site with the game switched off.
 *
 * The contract and the reasons are in the header of game-switches.js. When a
 * switchable game is added, add its three rules here, its entry in GAMES there,
 * and its id in catalogue.json gameSwitches; the unit test checks all three.
 */

/* Copy that names the game: shown only while it is on. */
html:not(.lgg-on-music-bingo) [data-lgg-switch~='music-bingo'],
html:not(.lgg-on-karaoke) [data-lgg-switch~='karaoke'] {
  display: none !important;
}

/* The copy that stands in for it: hidden once every game it stands in for is on. */
html.lgg-on-music-bingo [data-lgg-switch-off='music-bingo'],
html.lgg-on-karaoke [data-lgg-switch-off='karaoke'],
html.lgg-on-music-bingo.lgg-on-karaoke
  [data-lgg-switch-off~='music-bingo'][data-lgg-switch-off~='karaoke'] {
  display: none !important;
}

/* A page about the game shows nothing until it is known to be on; the script
   sends a visitor home once it is known to be off. */
html[data-lgg-switch-page='music-bingo']:not(.lgg-on-music-bingo) body,
html[data-lgg-switch-page='karaoke']:not(.lgg-on-karaoke) body {
  visibility: hidden !important;
}
