/* One quiet frame keeps the scene controls together. */
body.local-app #owned-worlds-button,
body.local-app #shared-worlds-button {
  display: none;
}
.topbar .brand {
  min-width: 0;
}
.topbar .brand .brand-logo {
  max-width: min(160px, 40vw, 100%);
}
.topbar .top-actions {
  flex: none;
  width: auto;
  gap: 6px;
  padding: 0;
}
.topbar .top-actions[hidden] {
  display: none;
}
.topbar .top-actions :is(button, a) {
  display: inline-flex;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid #ded1b31a;
  border-radius: 10px;
  background: #10151cb3;
  backdrop-filter: blur(16px);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  color: #e6dfd1;
}
.topbar .top-actions a:hover,
.topbar .top-actions button:hover,
.topbar .top-actions button[aria-expanded="true"] {
  background: linear-gradient(#e1d2af13, #e1d2af13), #10151cb3;
  color: #fff2d5;
}
.topbar .top-actions :is(button, a):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}
.toolbar-icon,
.toolbar-icon svg {
  display: block;
  width: 18px;
  height: 18px;
  flex: none;
}
.toolbar-icon {
  color: #c7c4bd;
}
.top-actions .toolbar-label {
  display: none;
}
.world-menu {
  position: fixed;
  inset: 60px 20px auto auto;
  margin: 0;
  padding: 6px;
  width: 340px;
  max-width: calc(100vw - 20px);
  max-height: calc(100dvh - 70px);
  overflow: auto;
  border: 1px solid #ded1b326;
  border-radius: 12px;
  background: #141b22f5;
  color: var(--ink);
  box-shadow: 0 12px 36px #0005;
  backdrop-filter: blur(16px);
}
.world-menu button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  font-size: 13px;
  text-align: left;
}
.world-menu button:hover {
  background: #e1d2af13;
}
.world-menu button:focus-visible {
  outline-offset: -2px;
}
.friend-chips {
  display: flex;
}
.friend-chips:empty {
  display: none;
}
.friend-chips i {
  position: relative;
  width: 22px;
  height: 22px;
  margin-left: -6px;
  overflow: hidden;
  border: 1px solid #141b22;
  border-radius: 50%;
  background: #2a2f38;
}
.friend-chips i:first-child {
  margin-left: 0;
}
.friend-chips img {
  position: absolute;
  top: -1px;
  left: 50%;
  width: 72px;
  translate: -50% 0;
}
.friend-chips span {
  align-self: center;
  margin-left: 3px;
  font-size: 11px;
}
.players-dialog {
  width: min(440px, calc(100vw - 28px));
  padding: 22px;
  border: 1px solid #ded1b333;
  border-radius: 18px;
  background: #141b22f5;
}
.players-dialog .modal-heading {
  gap: 12px;
}
.players-dialog h2 {
  font-size: 23px;
}
.players-dialog .players-close {
  padding: 8px 12px;
  border-color: #ded1b326;
  border-radius: 9px;
  background: transparent;
  font-size: 12px;
}
@media (max-width: 1050px) {
  .topbar .brand span {
    display: none;
  }
}
@media (max-width: 700px) {
  .topbar {
    justify-content: space-between;
    padding: 6px 10px;
  }
  .topbar .top-actions {
    width: auto;
    gap: 4px;
  }
  .topbar .top-actions :is(button, a) {
    padding: 0 10px;
  }
  .world-menu {
    right: 10px;
    top: 56px;
  }
}
@media (max-width: 380px) {
  .topbar {
    padding-inline: 6px;
  }
  .topbar .top-actions :is(button, a) {
    padding-inline: 8px;
  }
}

/* ☰ lists worlds, then the shown avatar's card (avatar-menu.mjs). A world
   is its name and a portrait per avatar there, in colour while online and
   in grey otherwise, then "+" for an open seat. */
.world-slot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  padding: 6px 8px;
  border-radius: 7px;
}
.world-slot[data-current="true"] {
  background: #dfc38d1c;
}
/* A world past Common has its tier's edge, as a card's rarity edge
   (world-level.mjs). */
.world-slot[data-world-tier] {
  box-shadow:
    inset 0 0 0 1px var(--world-tier),
    0 0 10px color-mix(in srgb, var(--world-tier) 35%, transparent);
}
.slot-name {
  flex: 1 0 96px;
  font-size: 13px;
}
.slot-mark {
  margin-left: 6px;
  color: var(--muted);
  font-size: 11px;
}
.avatar-status {
  color: var(--muted);
}
.slot-seats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.world-menu .seat-face {
  display: block;
  width: 32px;
  min-height: 0;
  padding: 0;
}
.seat-face img,
.slot-back img,
.world-menu .seat-open {
  display: block;
  box-sizing: border-box;
  width: 32px;
  height: 43px;
  border: 1px solid #44444c;
  border-radius: 6px;
  object-fit: cover;
  object-position: 50% 12%;
}
/* "+" is a seat-sized dashed card, its glyph centred, in every state. */
.world-menu .seat-open {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 0;
  border-style: dashed;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
}
.world-menu .seat-open:disabled {
  opacity: 0.35;
}
/* Your avatars: found ones face up (grey while in a world), then card
   backs, dim, for those not yet found (#1936). */
.slot-cast {
  margin: 8px 8px 0;
}
.slot-back {
  opacity: 0.6;
}
.slot-seat:not([data-lit="true"]) .seat-face img {
  filter: grayscale(1) brightness(0.7);
}
[data-kind="you"] .seat-face img {
  border: 2px solid #f3ead6;
}
/* One tap chooses a portrait (it glows); a second arms it in its level
   tier's colour (--tier-color). */
.world-menu .seat-face[aria-pressed="true"] img {
  outline: 2px solid var(--gold);
  box-shadow: 0 0 10px #dfc38daa;
}
.world-menu .seat-face[data-armed="true"] img {
  outline-color: var(--tier-color, var(--gold));
  box-shadow: 0 0 14px var(--tier-color, var(--gold));
  filter: none;
}
.world-menu .avatar-act {
  flex: 1 0 auto;
  justify-content: center;
  width: auto;
  min-height: 40px;
  padding: 6px 12px;
  border: 1px solid #b09a6a88;
  border-radius: 7px;
  color: #f2e3c4;
  font:
    15px/1.2 Georgia,
    serif;
}
.world-menu .slot-new {
  width: 100%;
  margin: 4px 0;
}
.avatar-status {
  margin: 4px 8px;
}
.avatar-status:empty {
  display: none;
}
/* The tools stay at the bottom while the slots scroll. */
.menu-tools {
  position: sticky;
  bottom: -6px;
  display: flex;
  border-top: 1px solid #ffffff1a;
  background: #141b22;
}
.world-menu .menu-tools button {
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  font-size: 12px;
}
/* The world's Lonely Forest logo in place of the COSYWORLD wordmark
   (title-logo.mjs): its own aspect ratio, as tall as the toolbar buttons so
   hand lettering reads. */
.brand .brand-logo {
  display: block;
  height: 46px;
  width: auto;
  max-width: min(160px, 40vw);
  object-fit: contain;
  border-radius: 6px;
}
/* The lettering keeps its colour; a world past Common glows softly in its
   tier (world-level.mjs), as does the Settings black screen's logo. */
:root[data-world-tier] :is(.brand .brand-logo, .settings-logo) {
  filter: drop-shadow(0 0 6px var(--world-tier));
}
.topbar .brand:has(.brand-logo) {
  display: flex;
  align-items: center;
}
/* Beside the logo, a covered world's "…" reads as a stray mark: the logo
   stands alone until the world's name is uncovered. */
.topbar .brand:has(.brand-logo) span[data-covered] {
  display: none;
}
@media (max-width: 700px) {
  .brand .brand-logo {
    height: 40px;
  }
}
