/* Gremlin Desks: the slim "back to the Desks" bar, shared by the rooms you reach from the welcome page.
   Markup (static, no JS needed):  <nav class="desks-bar" aria-label="Gremlin Desks"><a href="(path to site root)">&larr; Gremlin Desks</a></nav>
   Pages with body padding add class "bleed" and set --db-t / --db-r / --db-l to that padding so the bar runs edge to edge.
   Full-screen pages (Gremlin World) use a small pill inside their own HUD instead: <a class="desks-home ...">. */
.desks-bar {
  display: flex; align-items: center; gap: .5rem;
  min-height: 44px; margin: 0;
  padding: 0 max(.6rem, env(safe-area-inset-right)) 0 max(.6rem, env(safe-area-inset-left));
  background: #3A4A33; border-bottom: 2px solid #1A1A18;
  font: 600 .95rem/1.2 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  position: relative; z-index: 30;
}
.desks-bar.bleed {
  margin: calc(-1 * var(--db-t, 0px)) calc(-1 * var(--db-r, 0px)) 1rem calc(-1 * var(--db-l, 0px));
  padding-top: var(--db-safe-t, 0px);
}
.desks-bar a {
  display: inline-flex; align-items: center; gap: .35rem;
  min-height: 44px; padding: 0 .65rem; border-radius: 8px;
  color: #F1EDE2; text-decoration: none; letter-spacing: .01em;
}
.desks-bar a:hover { background: #54664A; text-decoration: underline; text-underline-offset: 3px; }
.desks-bar a:focus-visible { outline: 3px solid #E8E4D8; outline-offset: -4px; }
/* Gremlin World: pill inside the HUD, hidden when the world is embedded in another site's page. */
.desks-home { min-height: 44px; display: inline-flex; align-items: center; gap: .3rem; text-decoration: none; white-space: nowrap; flex: 0 0 auto; }
.desks-home:focus-visible { outline: 3px solid #B8775A; outline-offset: 2px; }
.framed .desks-home { display: none; }
/* Phones and portrait tablets: the HUD row is already full, so the pill sits just below it at top-left
   instead of squeezing the room name. */
@media (max-width: 820px) {
  .hud-left .desks-home { position: fixed; top: calc(max(6px, env(safe-area-inset-top)) + 62px); left: max(10px, env(safe-area-inset-left)); z-index: 5; }
}
@media (max-width: 560px) {
  .hud-left .desks-home { top: calc(max(6px, env(safe-area-inset-top)) + 54px); left: max(8px, env(safe-area-inset-left)); }
  body.noprompt #hint { top: 112px; }
}
/* Added to the Home Screen as an app: the visitor didn't come in through the welcome page, so no bar. */
@media (display-mode: standalone) { .desks-bar.app-hide { display: none; } }
@media print { .desks-bar, .desks-home { display: none !important; } }

/* Modest top-center "Enter the mall" control (injected by desks-bar.js). */
.desks-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}
.desks-bar > a:first-of-type { justify-self: start; }
.desks-mall-entry {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  text-decoration: none;
  white-space: nowrap;
  font: 600 .9rem/1.2 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #3A4A33;
  cursor: pointer;
}
.desks-mall-entry img { width: 22px; height: 20px; object-fit: contain; flex: 0 0 auto; }
.desks-mall-entry[hidden] { display: none !important; }
.desks-bar .desks-mall-entry--bar {
  justify-self: center;
  grid-column: 2;
  min-height: 32px;
  padding: 0 .65rem 0 .4rem;
  border-radius: 999px;
  background: #F1EDE2;
  color: #3A4A33;
  border: 1.5px solid #1A1A18;
  box-shadow: 1px 1px 0 #1A1A18;
}
.desks-bar .desks-mall-entry--bar:hover {
  background: #E8E4D8;
  color: #3A4A33;
  text-decoration: none;
}
.desks-bar .desks-mall-entry--bar:focus-visible {
  outline: 3px solid #E8E4D8;
  outline-offset: 2px;
}
.desks-mall-entry--pill {
  min-height: 36px;
  padding: 0 .7rem 0 .45rem;
  border-radius: 999px;
  background: #F1EDE2;
  color: #3A4A33;
  border: 2px solid #1A1A18;
  box-shadow: 2px 2px 0 #54664A;
  flex: 0 0 auto;
}
.desks-mall-entry--float {
  position: fixed;
  top: max(8px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  min-height: 36px;
  padding: 0 .75rem 0 .5rem;
  border-radius: 999px;
  background: #F1EDE2;
  color: #3A4A33;
  border: 2px solid #1A1A18;
  box-shadow: 2px 2px 0 #54664A;
}
.desks-mall-entry--pill:hover,
.desks-mall-entry--float:hover { background: #E8E4D8; }
.desks-mall-entry--pill:focus-visible,
.desks-mall-entry--float:focus-visible { outline: 3px solid #B8775A; outline-offset: 2px; }
.framed .desks-mall-entry { display: none !important; }
/* Phone: keep the float top-center, and reserve a slim strip so it does not cover back links. */
@media (max-width: 600px) {
  body:has(.desks-mall-entry--float:not([hidden])) {
    padding-top: max(3.2rem, calc(env(safe-area-inset-top) + 2.8rem));
  }
}
@media (max-width: 560px) {
  .desks-bar {
    display: flex;
    justify-content: space-between;
    gap: .35rem;
  }
  .desks-bar .desks-mall-entry--bar {
    justify-self: unset;
    grid-column: unset;
    flex: 0 0 auto;
    margin-left: auto;
    min-height: 32px;
    font-size: .85rem;
    padding: 0 .55rem 0 .35rem;
  }
  .hud-left .desks-mall-entry--pill {
    position: fixed;
    top: calc(max(6px, env(safe-area-inset-top)) + 54px);
    right: max(8px, env(safe-area-inset-right));
    left: auto;
    z-index: 5;
  }
}
@media (max-width: 820px) and (min-width: 561px) {
  .hud-left .desks-mall-entry--pill {
    position: fixed;
    top: calc(max(6px, env(safe-area-inset-top)) + 62px);
    right: max(10px, env(safe-area-inset-right));
    left: auto;
    z-index: 5;
  }
}
@media print { .desks-mall-entry { display: none !important; } }
