/* ── Grid Inventory ────────────────────────────────────────────── */

/* Ground item draggable rows in terminal */
li.room-item[draggable="true"] { cursor: grab; }
li.room-item[draggable="true"]:active { cursor: grabbing; }

#grid-inv-root {
  display: flex;
  justify-content: center;
  padding: 10px 0 8px;
  overflow-y: auto;
  flex: 1;
  background: #0d0d0d;
}

#grid-inv-root::-webkit-scrollbar { width: 4px; }
#grid-inv-root::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 2px; }

/* Container wrap — inline-block so it sizes to its grid */
.ginv-wrap {
  position: relative;
  flex-shrink: 0;
}

/* Slot background grid */
.ginv-grid {
  display: grid;
  gap: 2px;
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
}

.ginv-slot {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 3px;
  box-sizing: border-box;
}

/* Highlight states during drag */
.ginv-hl-ok   { background: rgba(0,   200,  80, 0.22) !important; border-color: #00c850 !important; }
.ginv-hl-err  { background: rgba(220,  50,  50, 0.22) !important; border-color: #dc3232 !important; }
.ginv-hl-swap { background: rgba(220, 140,   0, 0.22) !important; border-color: #dc8c00 !important; }

/* Items overlay layer */
.ginv-items-layer {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Item tile */
.ginv-item {
  position: absolute;
  pointer-events: all;
  box-sizing: border-box;
  background: rgba(18, 12, 6, 0.90);
  border: 1px solid rgba(155, 125, 65, 0.45);
  border-radius: 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: grab;
  overflow: hidden;
  user-select: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}

.ginv-item:hover {
  border-color: #e8c97a;
  box-shadow: 0 0 0 1px rgba(232, 201, 122, 0.22);
  z-index: 5;
}

.ginv-item:active { cursor: grabbing; }

.ginv-dragging { opacity: 0.30 !important; }
/* Item con flag isGlow: bordo luminoso pulsante */
.ginv-item--glow {
  border-color: rgba(255, 210, 80, 0.7);
  box-shadow: 0 0 6px 2px rgba(255, 200, 60, 0.55),
              inset 0 0 5px rgba(255, 200, 60, 0.12);
  animation: ginv-glow-pulse 2.2s ease-in-out infinite;
}
.ginv-item--glow:hover {
  border-color: #ffe066;
  box-shadow: 0 0 10px 4px rgba(255, 210, 60, 0.75),
              inset 0 0 6px rgba(255, 210, 60, 0.2);
}
@keyframes ginv-glow-pulse {
  0%, 100% { box-shadow: 0 0 5px 1px rgba(255, 200, 60, 0.45), inset 0 0 4px rgba(255,200,60,0.10); }
  50%      { box-shadow: 0 0 10px 4px rgba(255, 210, 60, 0.75), inset 0 0 7px rgba(255,210,60,0.22); }
}


/* Icon image inside item */
.ginv-item img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  pointer-events: none;
  flex-shrink: 0;
}

.ginv-icon {
  font-size: 18px;
  line-height: 1;
  pointer-events: none;
}

/* Name label */
.ginv-label {
  font-size: 9px;
  color: #c8a86a;
  font-family: monospace;
  text-align: center;
  line-height: 1.1;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 2px;
  pointer-events: none;
}

/* 1×1 tile: label hidden, icon slightly larger */
.ginv-item--sm .ginv-label { display: none; }
.ginv-item--sm img         { width: 30px; height: 30px; }
.ginv-item--sm .ginv-icon  { font-size: 22px; }

/* Ground-item drop target: whole grid lights up */
.ginv-wrap.ginv-ground-target {
  outline: 2px dashed #e8c97a;
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Qty badge ── */
.ginv-qty {
  position: absolute;
  bottom: 2px;
  right: 3px;
  font-size: 9px;
  font-weight: bold;
  font-family: monospace;
  color: #fff;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
  pointer-events: none;
  line-height: 1;
  z-index: 2;
}

/* ── Griglia zaino (ExpansionGrid) ── */
.equip-bag-root {
  display: none;
  justify-content: center;
  padding: 8px 6px;
  background: var(--lue-leather-bg);
  border-top: 1px solid var(--lue-leather-stitch);
  box-shadow:
    inset 1px 1px 0 var(--lue-leather-edge-hi),
    inset -1px -1px 0 var(--lue-leather-edge-lo);
  position: relative;
}
.equip-bag-root.active { display: flex; flex-direction: column; align-items: center; }
.equip-bag-label {
  font-family: var(--lue-font-ui);
  font-size: 6px;
  color: var(--lue-fg-gold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 5px;
  align-self: flex-start;
  padding: 0 2px;
}
.equip-bag-root .ginv-wrap {
  background: transparent;
  border: none;
  border-radius: 0;
}
.equip-bag-root .ginv-slot {
  background: var(--lue-leather-bg-dark);
  border: none;
  border-radius: 0;
  box-shadow:
    inset 1px 1px 0 var(--lue-leather-edge-lo),
    inset -1px -1px 0 var(--lue-leather-edge-hi);
}
.equip-bag-root .ginv-item {
  background: rgba(42,20,8,0.92);
  border: 1px solid var(--lue-leather-stitch);
  border-radius: 0;
}
.equip-bag-root .ginv-item:hover { border-color: var(--lue-fg-gold); }

/* ── Tile icons inline nel testo chat (look direzione, ecc.) ── */
.tile-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    vertical-align: middle;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    margin-right: 3px;
    flex-shrink: 0;
}
.look-entity { display: inline-flex; align-items: center; gap: 2px; }
.look-entity + .look-entity::before { content: ', '; }
.look-item .tile-icon { opacity: 0.88; }
.look-mob  .tile-icon { filter: drop-shadow(0 0 2px rgba(0,0,0,0.7)); }
