/* An equal-radius ring, with image-only targets and desktop hover labels. */
.buildMenu {
  position: fixed;
  inset: 0;
  z-index: 16;
  background: rgba(22, 32, 16, 0.72);
  pointer-events: auto;
  touch-action: none;
  zoom: 1;
}
body.bchoose .cmdbar {
  z-index: 18;
}
.buildMenu[hidden],
body.bchoose .dock {
  display: none;
}
.buildCircle {
  position: absolute;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(239, 225, 186, 0.13) 35%, rgba(239, 225, 186, 0.04) 60%, transparent 69%);
}
.buildCategory {
  position: absolute;
  transform: translate(-50%, -50%);
  width: var(--category-size);
  height: var(--category-size);
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: transparent;
  box-shadow: none;
  color: #fff4dc;
  font: 500 13px/1.08 Rubik, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.buildCategory img {
  width: var(--category-art);
  height: var(--category-art);
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 2px 2px #18200d);
}
.buildCategory span {
  position: absolute;
  top: calc(100% - 16px);
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  flex: none;
  width: max-content;
  max-width: 104px;
  padding: 1px 3px;
  border-radius: 5px;
  background: #25311c;
  text-align: center;
}
.buildCategory[data-category='food'] span,
.buildCategory[data-category='rides'] span,
.buildCategory[data-category='decor'] span {
  max-width: var(--category-size);
}
.buildCategory:focus-visible {
  background: rgba(255, 241, 187, 0.16);
  outline: 2px solid #ffda72;
  outline-offset: 2px;
}
@media (hover: hover) and (pointer: fine) {
  .buildCategory:hover {
    background: rgba(255, 241, 187, 0.16);
    outline: 2px solid #ffda72;
    outline-offset: 2px;
    z-index: 1;
  }
  .buildCategory:hover span {
    visibility: visible;
    opacity: 1;
  }
}
.buildCategory:active {
  filter: brightness(1.15);
}
.buildCentre {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: var(--return-size, 64px);
  color: #fff4dc;
  text-align: center;
}
.buildCentre h2 {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  margin: 0;
}
.buildDrawerHead button {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid #9e8158;
  border-radius: 12px;
  background: #f5e7cb;
  color: #392716;
  font: 500 14px Rubik, sans-serif;
  cursor: pointer;
}
.buildDrawerHead {
  grid-column: 1 / -1;
  grid-row: 1;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 0 6px;
}
.buildDrawerHead button {
  padding: 4px 12px;
}
/* Only construction/placement controls use the supplied check and cross. */
button.buildAction,
.placeBar button.buildAction,
.trackBar button.buildAction,
.toolChip button.buildAction {
  border: 0;
  border-image: none;
  border-radius: 50%;
  padding: 0;
  min-width: 44px;
  min-height: 44px;
  background: transparent;
  box-shadow: none;
  filter: drop-shadow(0 3px 1px rgba(24, 16, 8, 0.4));
}
button.buildAction img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}
button.buildAction:disabled {
  filter: grayscale(1);
  opacity: 0.55;
  cursor: not-allowed;
}
button.buildAction:focus-visible {
  outline: 3px solid #ffe497;
  outline-offset: 2px;
}
body.bchoose .hint,
body.bchoose .toolChip,
body.bchoose .qbub {
  visibility: hidden;
}
/* A phone rotated past the drawer's width breakpoint still needs its placement controls. */
@media (pointer: coarse) and (max-height: 699px) and (min-width: 701px) {
  body.placing:not(.popen):not(.qopen):is(:not(.bopen), .bmini) .placeBar:not([hidden]) {
    display: flex !important;
  }
  body.tracking:not(.popen):not(.qopen):is(:not(.bopen), .bmini) .trackBar:not([hidden]) {
    display: block !important;
  }
}
/* In short touch landscapes, stacked HUD/name/editor rows otherwise consume the entire map height. */
@media (pointer: coarse) and (orientation: landscape) and (max-height: 500px) {
  :is(body.placing, body.tracking, body.incamp) .hudL > :not(.rpill) {
    display: none !important;
  }
  :is(body.placing, body.tracking, body.incamp) .cmdbar {
    padding: 4px 6px;
    bottom: max(6px, env(safe-area-inset-bottom, 0px));
  }
  :is(body.placing, body.tracking, body.incamp) .cmdbar .cb {
    height: 52px;
    min-height: 44px;
    padding: 2px 4px;
  }
  :is(body.placing, body.tracking, body.incamp) .cmdbar .cb.big {
    height: 60px;
    width: 64px;
    margin-top: -8px;
  }
  body.placing .placeBar {
    left: 12px;
    right: 12px;
    bottom: calc(var(--cmdH, 76px) + 8px);
    transform: none;
    align-items: center;
    gap: 8px;
    height: 74px; /* fixed: a bar that grew with its label moved the map's free area (placeViewRect) */
  }
  body.placing .placeBar .pbName {
    position: static;
    flex: 1;
    min-width: 0;
    max-height: 74px;
    overflow-y: auto;
    box-sizing: border-box;
    transform: none;
    white-space: normal;
    touch-action: pan-y;
  }
  body.placing .placeBar > button {
    flex: none;
    width: 56px;
    height: 56px;
  }
  body.tracking:not(.popen):not(.qopen):is(:not(.bopen), .bmini) .trackBar:not([hidden]) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    align-items: center;
    gap: 8px;
  }
  body.tracking .trackBar .tbTop {
    min-width: 0;
    margin: 0;
  }
  body.tracking .trackBar .tbText small {
    font-size: 13px;
  }
  body.tracking .trackBar .tbBtns .btn {
    min-height: 44px;
    white-space: normal;
  }
}
/* A category is a modal item picker; category navigation belongs only to the radial chooser. */
body.bopen:not(.bmini):not(.bchoose) .dock {
  display: flex;
}
.dock {
  position: fixed;
  inset: 0;
  z-index: 17;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: rgba(22, 32, 16, 0.72);
  pointer-events: auto;
  zoom: 1;
}
.dock .tray {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  grid-template-rows: auto minmax(0, 1fr);
  width: calc(100% - 24px);
  height: calc(100dvh - 24px);
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border-width: 16px;
  overflow: hidden;
}
.buildDrawerHead {
  grid-column: 1 / -1;
  grid-row: 1;
  align-items: center;
  padding: 0 4px 8px;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 56px;
}
.buildDrawerHead h2 {
  grid-column: 2;
  min-width: 0;
  margin: 0;
  font: 500 28px/1.15 Rubik, sans-serif;
  text-align: center;
  overflow-wrap: anywhere;
}
#buildDrawerClose,
.buildMenuClose {
  flex: none;
  border: 0;
  border-image: none;
  padding: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
}
#buildDrawerClose {
  grid-column: 3;
  width: 56px;
  height: 56px;
  padding: 7px;
  background: var(--stone-round);
}
.buildMenuClose {
  width: var(--return-size, 64px);
  height: max(44px, calc(var(--return-size, 64px) * 0.82));
}
#buildDrawerClose img,
.buildMenuClose img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}
#buildDrawerClose:focus-visible,
.buildMenuClose:focus-visible {
  outline: 3px solid #ffda72;
  outline-offset: 2px;
}
.dock #items {
  grid-column: 1;
  grid-row: 2;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(116px, 1fr));
  align-content: start;
  gap: 12px;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 12px;
  touch-action: pan-y;
  overscroll-behavior: contain;
}
.dock .item {
  width: auto;
  min-width: 0;
  min-height: 156px;
  box-sizing: border-box;
}
/* Cards below the fold are laid out and painted only when they scroll near (a long tab froze a phone on its first draw) */
.dock #items > .item {
  content-visibility: auto;
  contain-intrinsic-size: auto 156px;
}
/* Path cards: the picture keeps its own box and the name sits at the bottom of the card, never over the picture. */
.dock #items > .item .tool-ico {
  flex: 1 0 auto;
  height: 96px;
  overflow: hidden;
}
.dock #items > .item .tool-ico img.path-thumb {
  height: 100%;
  object-fit: contain;
}
.dock #items > .item .tool-ico + b {
  margin-top: auto;
}
/* The paths are small flat pictures: compact cards, three to a row on a phone (the rides keep their big cards) */
.dock #items:has(> .item[data-tool='path']) {
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 8px;
}
.dock #items > .item[data-tool='path'],
.dock #items > .item[data-tool^='pt'] {
  min-height: 0;
  contain-intrinsic-size: auto 96px;
  padding: 3px 4px 5px;
}
.dock #items > .item[data-tool='path'] .tool-ico,
.dock #items > .item[data-tool^='pt'] .tool-ico {
  flex: none;
  height: 46px;
}
.dock #items > .item[data-tool='path'] b,
.dock #items > .item[data-tool^='pt'] b {
  font-size: 13px;
}
.dock #items > .item[data-tool='path'] span,
.dock #items > .item[data-tool^='pt'] span {
  font-size: 13px;
  flex-wrap: wrap;
}
.dock .scrollHint {
  grid-column: 1 / -1;
}
.dock .binfo {
  grid-column: 2;
  grid-row: 2;
  min-height: 0;
  overflow-y: auto;
}
.dock .tray::after {
  display: none;
}
@media (max-width: 850px) {
  .dock .tray {
    grid-template-columns: minmax(0, 1fr);
    width: calc(100% - 16px);
    height: calc(100dvh - 16px);
    border-width: 12px;
  }
  .dock .binfo {
    display: none;
  }
  .buildDrawerHead h2 {
    font-size: 24px;
  }
}
/* Desktop: the item picker is a panel at the bottom, above the command bar, and the park stays visible above it. Phones
   and touch screens keep the full-screen picker. */
@media (min-width: 701px) and (pointer: fine) {
  body.bopen:not(.bmini):not(.bchoose) .dock {
    inset: auto 0 var(--cmdH, 110px) 0;
    padding: 0 12px;
    background: transparent;
    align-items: flex-end;
    pointer-events: none;
  }
  .dock .tray {
    pointer-events: auto;
    width: min(1100px, 100%);
    /* three rows of cards (164 px each, gaps, the biome filter, the title, the rim), less on a short screen: the HUD stays clear */
    height: min(690px, calc(100dvh - var(--cmdH, 110px) - var(--hudB, 64px) - 16px));
    border-width: 14px;
  }
  .buildDrawerHead {
    padding-bottom: 4px;
  }
  .buildDrawerHead h2 {
    font-size: 22px;
  }
  .dock #items {
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
    grid-auto-rows: max-content;
    gap: 8px;
    padding: 8px;
  }
  .dock #items > .item {
    min-height: 0;
  }
  .dock #items > .item .tool-ico,
  .dock #items > .item > img {
    height: 56px;
  }
}
/* The biome filter above the cards, and the biome's picture on a card */
.bfilter {
  grid-column: 1 / -1;
  flex: 0 0 auto;
  min-height: 46px;
  align-items: center;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 3px;
  scrollbar-width: thin;
}
.bf {
  flex: 0 0 auto;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
  font: inherit;
  font-size: 13px;
  min-height: 40px;
  padding-inline: 12px;
  cursor: pointer;
}
.bico {
  width: 28px;
  height: 28px;
  object-fit: contain;
}
.bio {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
}
/* What the card is for, in its corner (the check mark with the count stays on the other side) */
.item .ctop {
  position: absolute;
  top: 6px;
  left: 6px;
  right: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}
.item .catI {
  width: 30px;
  height: 30px;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(40, 24, 8, 0.55));
  pointer-events: none;
  background: none;
}
.binfo h4 .catH,
.binfo .catH {
  width: 22px;
  height: 22px;
  vertical-align: -5px;
  margin-right: 6px;
  object-fit: contain;
}
.item .bio .bico {
  width: 34px;
  height: 34px;
}
/* Every tab: the cards of a row are as tall as its tallest card, and a card grows to fit what it says (a long line ran
   out of its card over the next one); the build cards keep their height as the least */
.dock #items > .item {
  align-self: stretch;
  height: auto;
  padding-bottom: 10px; /* (the card's painted rim is drawn over its padding: two-line text touched it) */
}
.dock #items > .item > b,
.dock #items > .item > span {
  flex: none;
  overflow-wrap: anywhere;
}
