/* 2.0 One Hand: the always-visible hotbar's new pieces. Its dock (.build-dock, which sets --slot per screen size)
   lives in style.css; this file loads first, so rules here that meet style.css's .inventory-hotbar and .hot-slot
   rules are written to be more specific. */

/* The HUD bar: picture, a count bottom-right, slot numbers only without touch. The selected slot has a thick white
   frame and sits 4 px higher. */
.inventory-hotbar.hand-bar { display:flex; gap:3px; margin:0; align-items:flex-end; }
.hand-bar .hot-slot { flex:none; width:var(--slot); height:var(--slot); padding:0; display:grid; place-items:center; border:2px solid #ffffff3d; border-radius:7px; background:linear-gradient(#2c3a47e6,#1b2632e6); transition:transform .08s; }
.hand-bar .hot-slot.selected { border:4px solid #fff; background:#3d4c58; box-shadow:0 0 0 2px #0009,0 5px 12px #0007; transform:translateY(-4px); }
.hand-bar .hot-slot .item-emoji { width:auto; height:auto; border:0; border-radius:0; font-size:calc(var(--slot) * .56); line-height:1; }
.hand-bar .hot-slot .item-tile { width:calc(var(--slot) * .6); height:calc(var(--slot) * .6); }
.hand-bar .hot-slot>b { right:3px; bottom:1px; font-size:max(10px,calc(var(--slot) * .27)); }
.hand-bar .hot-slot>small { left:3px; top:1px; }
.touch-mode .hand-bar .hot-slot>small { display:none; }

/* The 🎒 tile after slot 9. It bounces with an item's picture when that item goes to the backpack. */
.hand-bar .bag-tile { margin-left:5px; background:linear-gradient(#5d4732e6,#3a2c1fe6); border-color:#ffd99a77; }
.hand-bar .bag-tile .bag-icon { font-size:calc(var(--slot) * .56); line-height:1; }
.hand-bar .bag-tile.got { border-color:#ffe38a; animation:bagBounce .5s ease-out; }
@keyframes bagBounce { 0% { transform:translateY(0) scale(1); } 35% { transform:translateY(-12px) scale(1.15); } 70% { transform:translateY(0) scale(.95); } 100% { transform:translateY(0) scale(1); } }

/* An empty slot is a bare fist. */
.hand-bar .hot-slot.empty { background:#1b263299; }

/* A place or bite that can't happen: the slot wobbles. */
.hand-bar .hot-slot.wobble { animation:slotWobble .35s ease-in-out; }
.hand-bar .hot-slot.selected.wobble { animation:slotWobbleUp .35s ease-in-out; }
@keyframes slotWobble { 0%, 100% { transform:rotate(0); } 25% { transform:rotate(-12deg); } 50% { transform:rotate(10deg); } 75% { transform:rotate(-6deg); } }
@keyframes slotWobbleUp { 0%, 100% { transform:translateY(-4px) rotate(0); } 25% { transform:translateY(-4px) rotate(-12deg); } 50% { transform:translateY(-4px) rotate(10deg); } 75% { transform:translateY(-4px) rotate(-6deg); } }

/* While visiting, machines and chests only work in your own world: those slots carry a little house. */
.hot-slot .slot-home { position:absolute; left:1px; top:0; font-size:11px; font-style:normal; line-height:1; }

/* After choosing a slot, the item's picture and name float above the bar for 1.2 s (placed by explore.js). */
.slot-float { position:absolute; z-index:13; display:flex; align-items:center; justify-content:center; gap:8px; height:44px; padding:0 6px; pointer-events:none; opacity:0; color:#fff; font:900 18px var(--body); text-shadow:0 2px 3px #000, 0 0 8px #000a; white-space:nowrap; overflow:hidden; }
.slot-float.show { animation:slotFloat 1.2s ease-out forwards; }
.slot-float .item-emoji { width:auto; height:auto; border:0; font-size:30px; }
.slot-float .item-tile { width:30px; height:30px; }
@keyframes slotFloat { 0% { opacity:0; transform:translateY(8px); } 12% { opacity:1; transform:translateY(0); } 75% { opacity:1; } 100% { opacity:0; } }
.game-paused .slot-float, .quiz-open .slot-float { visibility:hidden; }

/* A block too hard for the held tool: a ghost of the pickaxe it needs pulses on its face for a second. */
.ghost-float .ghost-tool { opacity:.9; filter:drop-shadow(0 0 6px #fff); animation:ghostPulse .5s ease-in-out 2; }
.ghost-float .item-emoji { width:auto; height:auto; border:0; font-size:42px; }
.ghost-float .item-tile { width:40px; height:40px; }
@keyframes ghostPulse { 0%, 100% { transform:scale(1); opacity:.45; } 50% { transform:scale(1.25); opacity:1; } }

/* Picture prompts: a monster's strength, or one big button for a gem, a table or a machine nearby. */
.explore-prompt .prompt-pic { font-size:28px; line-height:1.1; min-width:64px; padding:6px 16px; }

/* Narrow portrait screens: the 🎒 tile stacks just above slot 9. */
@media (orientation:portrait) and (max-width:479px) {
  .inventory-hotbar.hand-bar { gap:2px; }
  .hand-bar .bag-tile { position:absolute; right:3px; bottom:calc(100% + 4px); margin:0; }
}

/* 2.0 Pop and Pickup: a stack still flying to the bar keeps its slot quiet; when it lands the slot flashes. */
.hand-bar .hot-slot.coming>:is(.item-emoji,.item-tile,b) { visibility:hidden; }
.hand-bar .hot-slot.landed { animation:slotLand .35s ease-out; }
.hand-bar .hot-slot.selected.landed { animation:slotLandUp .35s ease-out; }
@keyframes slotLand { 0% { transform:scale(1); } 40% { transform:scale(1.16); border-color:#ffe38a; box-shadow:0 0 12px #ffe38acc; } 100% { transform:scale(1); } }
@keyframes slotLandUp { 0% { transform:translateY(-4px) scale(1); } 40% { transform:translateY(-4px) scale(1.16); box-shadow:0 0 12px #ffe38acc; } 100% { transform:translateY(-4px) scale(1); } }

/* Lesson rewards fly from the quiz panel into their slots (placed and moved by explore.js flyIcon). */
.reward-fly { position:absolute; left:0; top:0; z-index:13; pointer-events:none; filter:drop-shadow(0 3px 4px #0009); }
.reward-fly .item-emoji { width:auto; height:auto; border:0; font-size:34px; line-height:1; }
.reward-fly .item-tile { width:34px; height:34px; }
