/* Shared by every game; keep header styles independent of each game's UI. */
.games-header { position: fixed; top: 0; left: 0; right: 0; width: 100%; z-index: 1000; flex-shrink: 0; background: #ffffffe6; backdrop-filter: blur(12px); border-bottom: 4px solid #38bdf8; box-shadow: 0 1px 3px #0f172a1a; font-family: 'Plus Jakarta Sans', sans-serif; }
.games-header .games-header-inner { box-sizing: border-box; max-width: 1600px; margin: 0 auto; padding: 5px 16px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.games-header-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.games-header a { text-decoration: none; }
.games-header .games-header-logo { display: block; width: auto; height: 34px; object-fit: contain; filter: drop-shadow(0 1px 2px #0000001a); }
.games-header-home { display: block; }
.games-header-grade { display: inline-block; padding: 4px 10px; border-radius: 999px; background: #fbbf24; color: #451a03; font: 700 12px/1.4 'Fredoka', sans-serif; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
.games-header .games-header-name { display: block; margin: 0; color: #64748b; font-size: 12px; font-weight: 600; line-height: 1.5; letter-spacing: normal; }
.games-header-controls, .games-header-control-group { display: flex; align-items: center; gap: 8px; }
.games-header .games-header-button { box-sizing: border-box; display: grid; place-items: center; width: 44px; height: 44px; min-height: 44px; padding: 0; border: 1px solid #bae6fd; border-radius: 50%; color: #0369a1; background: #fff; font: 600 18px/1 sans-serif; cursor: pointer; touch-action: manipulation; }
.games-header .games-header-button:hover { background: #e0f2fe; }
.games-header button:focus-visible, .games-header a:focus-visible { outline: 3px solid #38bdf8; outline-offset: 3px; }
.games-header [hidden], .games-header .hidden { display: none; }
@media (max-width: 639px) {
 .games-header .games-header-inner { gap: 8px; }
 .games-header .games-header-logo { max-width: 42vw; }
}
@media (min-width: 1600px) and (min-height: 850px) {
 .games-header .games-header-inner { max-width: 90vw; }
 .games-header .games-header-logo { height: 44px; }
 .games-header .games-header-button { width: 48px; height: 48px; font-size: 22px; }
}

/* Reserve the exact rendered header height; fixed positioning must not cover game content. */
.games-header-spacer { height: var(--games-header-height, 70px); flex: 0 0 auto; pointer-events: none; }
.games-header .games-header-controls { min-width: 0; margin-left: auto; justify-content: flex-end; }
.games-header .games-header-control-group { flex-wrap: nowrap; justify-content: flex-end; }
.games-header .games-header-button { flex: 0 0 auto; }
@media (max-width: 639px) {
  .games-header .games-header-inner { flex-wrap: nowrap; padding: 5px 10px; gap: 6px; }
  .games-header-brand { gap: 6px; flex: 0 1 auto; min-width: 0; }
  .games-header .games-header-logo { max-width: min(30vw, 130px); height: 26px; }
  .games-header-home { min-width: 0; }
  .games-header .games-header-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 24vw; }
  .games-header .games-header-controls, .games-header .games-header-control-group { gap: 4px; }
  .games-header .games-header-button { width: 36px; height: 36px; min-height: 36px; }
}
@media (max-width: 390px) {
  .games-header .games-header-logo { max-width: 24vw; }
  .games-header .games-header-grade { padding: 3px 6px; font-size: 10px; }
  .games-header .games-header-name { font-size: 10px; }
  .games-header .games-header-button { width: 32px; height: 32px; min-height: 32px; }
}

/* Uniform control order across games. Buttons that a game does not support are omitted. */
.games-header #backToMenuBtn, .games-header #backToSetup { order: 10; }
.games-header #pauseBtn, .games-header #pauseGame { order: 20; }
.games-header #restartGame { order: 30; }
.games-header #audioToggleBtn { order: 40; }
.games-header #infoBtn, .games-header #setupInfoBtn { order: 50; }
.games-header #fullscreenToggleBtn, .games-header #setupFullscreenBtn { order: 60; }

/* One icon treatment for every game and every control state. */
.games-header .games-control-icon { width: 22px; height: 22px; display: block; flex: none; stroke: currentColor; }
@media (min-width: 1600px) and (min-height: 850px) { .games-header .games-control-icon { width: 25px; height: 25px; } }
@media (max-width: 390px) { .games-header .games-control-icon { width: 19px; height: 19px; } }

/* Game-center shortcut beside the shared banner. */
.games-header .games-header-center { display: flex; align-items: center; justify-content: center; flex: 0 0 auto; border-radius: 8px; font-weight:bold; font-size:16px; line-height:1.2rem; padding:0px 10px;}
.games-header .games-header-center-image { display: block; width: 46px; height: 46px; object-fit: contain; }
.games-header .games-header-brand > a {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  padding: 0 10px;
  border-radius: 8px;
  transition: background-color .18s ease;
}
.games-header .games-header-brand > .games-header-home {
  flex-direction: column;
  align-items: flex-start;
}
.games-header .games-header-brand > a:hover {
  background: #e0f2fe;
}
@media (max-width: 639px) {
  .games-header .games-header-brand > a { padding: 0 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .games-header .games-header-brand > a { transition: none; }
}
@media (max-width: 639px) {
  .games-header .games-header-center-image { width: 26px; height: 26px; }
  .games-header .games-header-home { flex: 0 1 auto; }
}
@media (min-width: 1600px) and (min-height: 850px) {
  .games-header .games-header-center-image { width: 44px; height: 44px; }
}