.forge-hunt {
  position: fixed;
  z-index: 6;
  top: calc(max(200px, env(safe-area-inset-top) + 200px) + var(--zone-row, 0px));
  inset-inline-end: max(8px, env(safe-area-inset-right));
  width: min(15.5rem, 48vw);
  max-height: calc(100dvh - 8px);
  box-sizing: border-box;
  color: #f5ead9;
  background: #151b1bf2;
  border: 1px solid #97714a;
  border-radius: .55rem;
  box-shadow: 0 6px 20px #0008;
  font-size: .78rem;
}
.forge-hunt.floating { inset-inline-end: auto; z-index: 14; }
.forge-hunt.floating.behind { z-index: 13; }
.forge-hunt[hidden], .forge-hunt [hidden] { display: none !important; }
.forge-hunt-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  background: #2b221b;
  border-radius: .5rem .5rem 0 0;
}
.forge-hunt.floating .forge-hunt-head { grid-template-columns: auto minmax(0, 1fr) auto; }
.forge-hunt.floating .forge-hunt-head button:first-child { grid-column: 2; grid-row: 1; }
.forge-hunt.floating .forge-hunt-head button:last-child { grid-column: 3; grid-row: 1; }
.forge-hunt-grip {
  grid-column: 1;
  grid-row: 1;
  display: grid;
  place-items: center;
  min-width: 34px;
  min-height: 36px;
  border-inline-end: 1px solid #61462f;
  color: #edba87;
  cursor: grab;
  touch-action: none;
}
.forge-hunt-grip::before {
  content: "";
  width: 14px;
  height: 18px;
  background: radial-gradient(circle, currentColor 1.25px, transparent 1.55px) 0 0 / 7px 6px;
  pointer-events: none;
}
.forge-hunt.dragging .forge-hunt-grip { cursor: grabbing; }
.forge-hunt.folded .forge-hunt-head { border-radius: .5rem; }
.forge-hunt button {
  min-height: 36px;
  padding: .25rem .34rem;
  background: transparent;
  border: 0;
  color: #f1cb98;
  font: inherit;
  cursor: pointer;
}
.forge-hunt button:focus-visible { outline: 2px solid #ffe3b5; outline-offset: -2px; }
.forge-hunt-head button:first-child { min-width: 0; padding-left: .52rem; font-weight: 750; text-align: start; overflow-wrap: anywhere; }
.forge-hunt-head button:last-child { min-width: 40px; border-inline-start: 1px solid #61462f; font-size: 1rem; }
.forge-hunt-body { border-top: 1px solid #6a5037; }
.forge-hunt-materials {
  display: grid;
  gap: 2px;
  max-height: min(12.5rem, 31dvh);
  margin: 0;
  padding: .24rem;
  overflow: auto;
  touch-action: pan-y;
  list-style: none;
  scrollbar-width: thin;
}
.forge-hunt-material {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .25rem;
  min-width: 0;
  padding: .19rem .23rem;
  border-radius: .25rem;
  background: #222825;
}
.forge-hunt-material .item-icon { --s: 28px; }
.forge-hunt-material-copy { display: grid; gap: .14rem; min-width: 0; overflow-wrap: anywhere; line-height: 1.1; }
.forge-hunt :is(small, strong, b) { line-height: 1.15; }
.forge-hunt small { color: #dac3a8; font-size: .67rem; }
.forge-hunt-counts { display: grid; justify-items: end; white-space: nowrap; font-variant-numeric: tabular-nums; }
.forge-hunt-counts .missing { color: #ffb9a3; }
.forge-hunt-counts .ready, .forge-hunt-done { color: #ccedb2; }
.forge-hunt-done { margin: .3rem .42rem 0; font-size: .73rem; }
.forge-hunt-body > button { display: block; min-height: 36px; margin-inline-start: auto; padding-inline: .55rem; font-size: .72rem; }
@media (min-width: 1200px) and (min-height: 740px) {
  .forge-hunt { top: calc(max(270px, env(safe-area-inset-top) + 270px) + var(--zone-row, 0px)); }
}
@media (max-width: 699px), (min-width: 560px) and (max-height: 520px) {
  .forge-hunt { top: calc(var(--hud-t, 8px) + 192px + var(--zone-row, 0px)); inset-inline-end: var(--hud-r, 8px); }
  .forge-hunt button { min-height: 44px; }
  .forge-hunt-grip { width: 44px; min-height: 44px; }
  .forge-hunt-head button:last-child { width: 44px; }
  .forge-hunt-material .item-icon { --s: 22px; }
  .forge-hunt-material-copy strong { font-size: .71rem; }
  .forge-hunt small { font-size: .63rem; }
}
@media (min-width: 560px) and (max-height: 520px) {
  .forge-hunt { inset-inline-end: calc(var(--hud-r, 8px) + 112px); top: calc(var(--hud-t, 8px) + 53px); }
  .forge-hunt-materials { max-height: 22dvh; }
}
