/* The site's top bar on the Keyboard Games' own pages (the owner, 14 November 2026: "the navbar has disappeared? when
   i am playing"). server.js keyboardGame puts the site's own <header class="topbar"> (the built Keyboard Games page's)
   at the top of each game's page; these are site.css's top bar rules alone, its colours on the bar itself rather than
   the page, so a game's own look is untouched. Purple in every theme, black in high contrast, white words. Sizes in px,
   as the site's are at its 16 px: a game's own text is bigger (The Emu's 20 px) and mustn't make the bar bigger. */
.topbar {
  --kb-bar: #47279a;
  --kb-bar-ink: #ffffff;
  --kb-bar-line: rgba(255, 255, 255, 0.12);
  --kb-gutter: 16px;
  position: relative;
  z-index: 50;
  background: var(--kb-bar);
  border-bottom: 1px solid var(--kb-bar-line);
  font-family: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.6;
}
@media (prefers-contrast: more) {
  .topbar { --kb-bar: #000000; --kb-bar-line: #ffffff; border-bottom-width: 2px; }
}
@media (min-width: 600px) { .topbar { --kb-gutter: 24px; } }
@media (min-width: 1024px) { .topbar { --kb-gutter: 32px; } }

.topbar *, .topbar *::before, .topbar *::after { box-sizing: border-box; }
.topbar .wrap {
  width: 100%;
  max-width: calc(1160px + 2 * var(--kb-gutter));
  margin: 0 auto;
  padding: 0 var(--kb-gutter);
}
.topbar-inner {
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  min-height: 68px;
}
.topbar .brand {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  text-decoration: none;
  border-radius: 12px;
}
.topbar .brand img { display: block; width: auto; height: 40px; flex: none; }
/* (the white logo on the purple bar) */
.topbar .brand .on-light { display: none; }
.topbar .brand .on-dark { display: block; }
.topbar :focus-visible { outline: 3px solid var(--kb-bar-ink); outline-offset: 3px; }

.topbar .site-nav { margin-left: auto; }
.topbar .site-nav ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.topbar .site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--kb-bar-ink);
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
}
.topbar .site-nav a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.topbar .site-nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 6px; }

@media (max-width: 600px) {
  .topbar-inner { padding-top: 6px; padding-bottom: 6px; }
  .topbar .site-nav { width: 100%; }
  .topbar .site-nav a { padding: 8px 10px; }
}
@media (max-width: 480px) {
  .topbar .site-nav ul { column-gap: 0; }
  .topbar .site-nav a { padding: 8px 6px; min-width: 44px; justify-content: center; font-size: 14.4px; }
}
@media (max-width: 440px) {
  .topbar-inner { gap: 8px; }
  .topbar .brand img { height: 34px; }
}
@media (max-width: 359px) {
  .topbar .site-nav a { padding-left: 3px; padding-right: 3px; font-size: 13.6px; }
}
@media (forced-colors: active) {
  .topbar { border-color: CanvasText; }
  .topbar .site-nav a[aria-current="page"] { text-decoration: underline; }
}
