/* Stall-Merge on top of Survivor's HerpDerp skin (../css/style.css): the in-game HUD reuses
   Survivor's own pieces as they are (#hud, #topbar wood tab, .slot boxes, .banner) and the shared
   Puddlehold menu. Jersey 10 is sharp only at 56/3 px or twice that. */
html, body { margin: 0; height: 100%; overflow: hidden; background: #3a2210; }
canvas#game { display: block; position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; }

/* no XP bar in this game, so the tab sits at the very top */
#topbar { top: env(safe-area-inset-top, 0px); }
/* every animal icon is the same trimmed square, shown inside its slot at one size */
#hud .slot img { width: 100%; height: 100%; object-fit: contain; box-sizing: border-box; padding: 2px; image-rendering: auto; }
#topbar .slot { width: 28px; height: 28px; display: grid; place-items: center; }
#topbar .tb { display: flex; align-items: center; gap: 6px; }
#hud .banner { top: calc(env(safe-area-inset-top, 0px) + 60px); bottom: auto; white-space: nowrap; }

/* bottom row (the player's own things, as in the HUD grid): basket, animal ladder, pitchfork.
   All of them are Survivor's slot boxes. */
#bottom {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 8px);
  display: flex; align-items: flex-end; gap: 8px;
}
#ladder { display: flex; gap: 2px; align-self: center; }
#ladder .slot { --s: min(32px, calc((100vw - 136px) / 10)); width: var(--s); height: var(--s); display: grid; place-items: center; }
#ladder .slot img { filter: brightness(0) opacity(.5); }
#ladder .slot.seen img { filter: none; }
/* basket and pitchfork: the same slot box, a bigger touch target, icon at the same fill */
#hud .tool { pointer-events: auto; width: 44px; height: 44px; padding: 0; cursor: pointer; display: grid; place-items: center; }
#hud .tool img { position: absolute; inset: 0; padding: 4px; }
#btnBasket:not(:has(#basketImg.hidden)) .icon { opacity: .35; }
/* used up: dimmed, but opaque like the other slot boxes */
#hud .tool.off { filter: saturate(.3) brightness(.7); }
#hud .tool i { font-size: var(--px); }
#topbar .ord { display: flex; flex-direction: column; line-height: .9; }
#topbar .ord span { color: var(--muted); }
/* phones: the tab moves left and keeps clear of the system buttons top right (as in Idle-Dorf);
   the animal icons say "next" and "order" on their own */
@media (max-width: 520px) {
  #topbar { left: calc(6px + env(safe-area-inset-left, 0px)); transform: none; max-width: calc(100vw - 72px); }
  #nextLbl, #orderLbl { display: none; }
}

#modal { z-index: 30; }
/* the line under the record list (X-14) */
.hdev { margin: 2px 0 0; text-align: center; color: var(--phm-brown); }
