/* The site shell (#626/#627): the one top bar shared by the game, the docs
   (mkdocs-material) and the API reference (Doxygen). Self-contained: its own
   --ahn-* tokens, so it neither depends on nor disturbs the host page's CSS.
   Day/night follows html[data-theme] (set by the game and web/shell/shell.js
   from the shared 'ahn-theme' key), else the OS preference. */
:root {
  --ahn-card: rgba(255, 255, 255, 0.94);
  --ahn-card-2: #f5f7fa;
  --ahn-border: #d5dde7;
  --ahn-ink: #0f172a;
  --ahn-ink-2: #3f4b5e;
  --ahn-muted: #556173;
  --ahn-accent: #2563eb;
  --ahn-soft: #dbe7fd;
  --ahn-elev: 0 1px 2px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.07);
  --ahn-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  /* one colour per place, as on the hub */
  --ahn-play: #2563eb;
  --ahn-guide: #0f766e;
  --ahn-lab: #7c3aed;
  --ahn-shop: #b45309;
  --ahn-arch: #475569;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ahn-card: rgba(16, 26, 45, 0.94); --ahn-card-2: #16223a; --ahn-border: #23324d;
    --ahn-ink: #eef3fa; --ahn-ink-2: #bcc7d8; --ahn-muted: #9aa8bd; --ahn-accent: #60a5fa; --ahn-soft: #1b2e52;
    --ahn-elev: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.35);
    --ahn-play: #60a5fa; --ahn-guide: #2dd4bf; --ahn-lab: #a78bfa; --ahn-shop: #f59e0b; --ahn-arch: #94a3b8;
  }
}
:root[data-theme="dark"] {
  --ahn-card: rgba(16, 26, 45, 0.94); --ahn-card-2: #16223a; --ahn-border: #23324d;
  --ahn-ink: #eef3fa; --ahn-ink-2: #bcc7d8; --ahn-muted: #9aa8bd; --ahn-accent: #60a5fa; --ahn-soft: #1b2e52;
  --ahn-elev: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.35);
  --ahn-play: #60a5fa; --ahn-guide: #2dd4bf; --ahn-lab: #a78bfa; --ahn-shop: #f59e0b; --ahn-arch: #94a3b8;
}

.ahn-bar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin: 10px 12px; padding: 6px 8px 6px 12px; min-height: 52px; box-sizing: border-box;
  background: var(--ahn-card); color: var(--ahn-ink);
  border: 1px solid var(--ahn-border); border-radius: 16px; box-shadow: var(--ahn-elev);
  font: 600 15px/1.3 var(--ahn-font);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.ahn-bar * { box-sizing: border-box; }
.ahn-brand { display: inline-flex; align-items: center; gap: 9px; margin-right: 8px; color: var(--ahn-ink); text-decoration: none; font-weight: 800; font-size: 17px; letter-spacing: -0.01em; }
.ahn-sub { font-weight: 600; font-size: 12px; color: var(--ahn-muted); padding: 2px 8px; border: 1px solid var(--ahn-border); border-radius: 999px; }
.ahn-logo { width: 28px; height: 28px; border-radius: 8px; flex: none; background: conic-gradient(from 200deg, #2563eb, #0f766e, #f59e0b, #2563eb); }
.ahn-places { display: flex; gap: 2px; flex-wrap: wrap; }
.ahn-place { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 11px; color: var(--ahn-ink-2); text-decoration: none; font: 700 15px/1.3 var(--ahn-font); }
.ahn-place i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.ahn-place[data-place="play"] i { background: var(--ahn-play); }
.ahn-place[data-place="guide"] i { background: var(--ahn-guide); }
.ahn-place[data-place="lab"] i { background: var(--ahn-lab); }
.ahn-place[data-place="shop"] i { background: var(--ahn-shop); }
.ahn-place[data-place="arch"] i { background: var(--ahn-arch); }
.ahn-place:hover { background: var(--ahn-card-2); color: var(--ahn-ink); }
.ahn-place[aria-current="page"] { background: var(--ahn-soft); color: var(--ahn-ink); box-shadow: inset 0 0 0 1px var(--ahn-border); }
.ahn-search { position: relative; margin-left: auto; }
.ahn-search input {
  width: 260px; max-width: 46vw; padding: 8px 12px; border-radius: 11px;
  border: 1px solid var(--ahn-border); background: var(--ahn-card-2); color: var(--ahn-ink);
  font: 600 14px var(--ahn-font);
}
.ahn-search input:focus { outline: 2px solid var(--ahn-accent); outline-offset: 1px; }
.ahn-results {
  position: absolute; right: 0; top: calc(100% + 6px); width: min(480px, 92vw); max-height: 60vh; overflow: auto;
  margin: 0; padding: 6px; list-style: none; background: var(--ahn-card); border: 1px solid var(--ahn-border);
  border-radius: 14px; box-shadow: var(--ahn-elev); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.ahn-results a { display: block; padding: 8px 10px; border-radius: 10px; color: var(--ahn-ink); text-decoration: none; }
.ahn-results a:hover, .ahn-results a:focus { background: var(--ahn-soft); outline: none; }
.ahn-results small { display: block; color: var(--ahn-muted); font-weight: 500; }
.ahn-results .ahn-place-tag { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.ahn-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 11px;
  border: 1px solid var(--ahn-border); background: var(--ahn-card-2); color: var(--ahn-ink-2);
  font: 800 15px var(--ahn-font); text-decoration: none; cursor: pointer;
}
.ahn-btn:hover { border-color: var(--ahn-accent); color: var(--ahn-ink); }
.ahn-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 720px) {
  /* phone: brand + buttons, then search, then the places as one scrolling row;
     the bar scrolls away instead of covering a third of the screen */
  .ahn-bar { position: relative; margin: 6px; gap: 6px; }
  .ahn-sub { display: none; }
  .ahn-brand { margin-right: auto; }
  .ahn-search { order: 8; width: 100%; margin-left: 0; }
  .ahn-search input { width: 100%; max-width: none; }
  .ahn-places { order: 9; width: 100%; flex-wrap: nowrap; overflow-x: auto; }
  .ahn-place { padding: 6px 9px; font-size: 14px; white-space: nowrap; }
}

/* The breadcrumb (#652): the trail from the site root to the page, on every
   docs page (in its title bar) and every API page. The place is in its colour. */
.ahn-crumb { min-width: 0; font: 700 14px var(--ahn-font); color: var(--ahn-muted); }
.ahn-crumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; margin: 0; padding: 0; list-style: none; }
.ahn-crumb li { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.ahn-crumb li + li::before { content: "›" / ""; color: var(--ahn-muted); }
.ahn-crumb a { color: inherit; text-decoration: none; }
.ahn-crumb a:hover, .ahn-crumb a:focus-visible { text-decoration: underline; }
.ahn-crumb [aria-current="page"] { color: var(--ahn-ink); font-weight: 800; overflow-wrap: anywhere; }
.ahn-crumb li:nth-child(2) > * { font-weight: 800; }
.ahn-crumb[data-place="guide"] li:nth-child(2) > * { color: var(--ahn-guide); }
.ahn-crumb[data-place="lab"] li:nth-child(2) > * { color: var(--ahn-lab); }
.ahn-crumb[data-place="shop"] li:nth-child(2) > * { color: var(--ahn-shop); }
.ahn-crumb[data-place="arch"] li:nth-child(2) > * { color: var(--ahn-arch); }
