/* Game page on a small screen (theme 1.43.1). Loaded only on a game that plays on its own page, when "On small screens, open games full screen" is on.
 * The full screen and its control panel are the Backend Engine plugin's own (the strip with Back, Info and More Games above the game, which
 * takes its own room, so nothing floats over the game). The theme only (1) starts the plugin's full screen on a small screen (gameplay.js) and
 * (2) styles that strip for the visitor's age group, through data-mood on .game-stage (set by gameplay.js, same moods as the home page):
 *   little  Toddlers  big, round, colourful, with labels        play  Kids  chunky pills with labels
 *   bold    Tweens    square-ish dark buttons, colour edge       calm  Teens and family  small quiet icon buttons
 * "Small screen" means a window or screen up to 1024px wide. */

/* Before the first paint on a small screen the page waits (hidden) so the normal page never flashes before the full screen starts.
 * gameplay.js takes this class off as soon as the full screen is on, or after a moment if it cannot start. */
html.bxd-game-immersive, html.bxd-game-immersive body { overflow: hidden; }
html.bxd-game-immersive body > * { visibility: hidden; }
html.bxd-game-immersive .game-stage { visibility: visible; }

/* ---------- The plugin's strip, styled by age group ---------- */
.game-stage--fullscreen[data-mood] {
  --ac: var(--age-c, #EE8A2E); --ac-ink: var(--age-ink, #081018);
  --bx-accent: var(--ac);
  /* 1.44.1: softer, less bright strip. Button fill = the age colour eased toward the dark bar; icons and words = a soft off-white. */
  --gb-fill: color-mix(in srgb, var(--ac) 78%, #0F1B29);
  --gb-fg: #CDD5DC;
  --gb-line: rgba(255, 255, 255, .42);
  --gb-h: 2.25rem; --gb-icon: 1rem; --gb-fs: .8125rem; --gb-pad: .75rem; --gb-gap: .375rem;
}
.game-stage--fullscreen[data-mood] .game-stage__fs-bar {
  gap: var(--gb-gap);
  padding: calc(env(safe-area-inset-top, 0px) + .25rem) calc(env(safe-area-inset-right, 0px) + .5rem) .25rem calc(env(safe-area-inset-left, 0px) + .5rem);
}
.game-stage--fullscreen[data-mood] :is(.game-stage__back, .game-stage__menu-toggle, .game-stage__more-games) {
  width: auto; min-width: var(--gb-h); height: var(--gb-h); padding: 0 var(--gb-pad); gap: .4rem; font: inherit; font-size: var(--gb-fs); font-weight: 800;
  background: var(--gb-fill); color: var(--ac-ink); border-radius: 999px; touch-action: manipulation;
}
.game-stage--fullscreen[data-mood] :is(.game-stage__back, .game-stage__menu-toggle, .game-stage__more-games) .game-stage__icon svg { width: var(--gb-icon); height: var(--gb-icon); stroke-width: 2.25; }
.game-stage--fullscreen[data-mood] .game-stage__menu-toggle[aria-expanded="true"],
.game-stage--fullscreen[data-mood] .game-stage__more-games[aria-expanded="true"] { color: var(--ac-ink); box-shadow: inset 0 0 0 2px var(--gb-line); }
/* Words on Back and Info (the plugin's buttons are icon only; the words come from their own labels). */
.game-stage--fullscreen[data-mood]:not([data-mood="calm"]) :is(.game-stage__back, .game-stage__menu-toggle)::after { content: attr(aria-label); }
.game-stage--fullscreen[data-mood] :is(.game-stage__back, .game-stage__menu-toggle, .game-stage__more-games):focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

.game-stage--fullscreen[data-mood="little"] { --gb-h: 2.75rem; --gb-icon: 1.125rem; --gb-fs: .9375rem; --gb-pad: .875rem; --gb-gap: .5rem; }
.game-stage--fullscreen[data-mood="little"] :is(.game-stage__back, .game-stage__menu-toggle, .game-stage__more-games) {
  border: .125rem solid var(--gb-line); box-shadow: 0 .125rem 0 rgba(0, 0, 0, .4);
}
.game-stage--fullscreen[data-mood="play"] { --gb-h: 2.5rem; --gb-icon: 1rem; --gb-fs: .875rem; }

.game-stage--fullscreen[data-mood="bold"] { --gb-h: 2.25rem; --gb-icon: 1rem; --gb-fs: .8125rem; --gb-pad: .75rem; }
.game-stage--fullscreen[data-mood="bold"] :is(.game-stage__back, .game-stage__menu-toggle, .game-stage__more-games) {
  border-radius: .625rem; background: rgba(8, 16, 24, .84); color: var(--gb-fg); border-bottom: .1875rem solid var(--gb-fill); box-shadow: none;
}
.game-stage--fullscreen[data-mood="bold"] .game-stage__icon { color: var(--gb-fill); }
.game-stage--fullscreen[data-mood="bold"] :is(.game-stage__menu-toggle, .game-stage__more-games)[aria-expanded="true"] { color: var(--gb-fg); box-shadow: none; border-bottom-color: var(--gb-fg); }

.game-stage--fullscreen[data-mood="calm"] { --gb-h: 2rem; --gb-icon: 1rem; --gb-pad: 0; --gb-gap: .375rem; }
.game-stage--fullscreen[data-mood="calm"] :is(.game-stage__back, .game-stage__menu-toggle, .game-stage__more-games) {
  background: rgba(8, 16, 24, .55); color: var(--gb-fg); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .22);
}
.game-stage--fullscreen[data-mood="calm"] .game-stage__more-games { padding: 0 .75rem; }
.game-stage--fullscreen[data-mood="calm"] :is(.game-stage__menu-toggle, .game-stage__more-games)[aria-expanded="true"] { color: var(--gb-fill); box-shadow: inset 0 0 0 1.5px var(--gb-fill); }

/* Landscape phones: slimmer strip. */
@media (max-height: 500px) {
  .game-stage--fullscreen[data-mood] { --gb-h: 2rem; --gb-icon: .9375rem; --gb-fs: .75rem; --gb-pad: .625rem; }
  .game-stage--fullscreen[data-mood="calm"] { --gb-pad: 0; }
}
@media (prefers-reduced-motion: reduce) { .game-stage--fullscreen[data-mood] :is(.game-stage__back, .game-stage__menu-toggle, .game-stage__more-games) { transition: none; } }
