/* Vanilla-ish inventory slot + hover tooltip for the relic catalog. */

.catalog-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 14px 0 18px;
}
.catalog-tools input[type="search"] {
  flex: 1;
  min-width: 180px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 14px;
}
.catalog-tools select {
  min-height: 44px;
  background: var(--panel-2);
  color: var(--ink);
  border: 1px solid var(--line);
  font-family: var(--mono);
  padding: 8px 10px;
}
.catalog-status {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--yellow);
  margin: 0 0 12px;
}

.mc-inv {
  display: grid;
  grid-template-columns: repeat(auto-fill, 44px);
  gap: 3px;
  padding: 10px;
  background: #c6c6c6;
  border: 4px solid;
  border-color: #fff #555 #555 #fff;
  image-rendering: pixelated;
  width: 100%;
  box-sizing: border-box;
}

.mc-slot {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 2px solid;
  border-color: #373737 #fff #fff #373737;
  background: #8b8b8b;
  position: relative;
  cursor: pointer;
}
.mc-slot:focus-visible, .mc-slot[aria-pressed="true"] {
  outline: 2px solid #ffff55;
  outline-offset: 0;
}
.mc-slot .mc-icon {
  width: 32px;
  height: 32px;
  margin: 4px;
  position: relative;
  image-rendering: pixelated;
  background-size: 32px 32px;
  background-repeat: no-repeat;
  background-position: center;
}
.mc-slot .mc-icon.missing {
  background-image: none;
  background-color: #f800f8;
  background-image: linear-gradient(45deg, #000 25%, transparent 25%),
    linear-gradient(-45deg, #000 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #000 75%),
    linear-gradient(-45deg, transparent 75%, #000 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
.mc-slot .mc-icon .dye {
  position: absolute;
  inset: 0;
  mix-blend-mode: multiply;
  pointer-events: none;
}
.mc-slot .mc-icon.glint::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../img/mc/misc/enchanted_glint_item.png") repeat;
  background-size: 64px 64px;
  mix-blend-mode: plus-lighter;
  opacity: 0.35;
  animation: mc-glint 4s linear infinite;
  pointer-events: none;
}
.mc-count {
  position: absolute;
  right: 3px;
  bottom: 1px;
  color: #fff;
  font-family: "Minecraft", var(--mono), monospace;
  font-size: 12px;
  text-shadow: 1px 1px #3f3f3f;
  pointer-events: none;
  line-height: 1;
}

@keyframes mc-glint {
  from { background-position: 0 0; }
  to { background-position: 64px 64px; }
}

.mc-tooltip {
  position: fixed;
  z-index: 80;
  max-width: min(360px, calc(100vw - 16px));
  padding: 4px 4px 5px;
  background: #100010;
  color: #fff;
  font-family: "Minecraft", var(--mono), monospace;
  font-size: 16px;
  line-height: 20px;
  letter-spacing: 0.5px;
  pointer-events: none;
  box-shadow:
    4px 0 0 0 #100010,
    -4px 0 0 0 #100010,
    0 4px 0 0 #100010,
    0 -4px 0 0 #100010,
    2px 0 0 0 #2d0a5a,
    -2px 0 0 0 #2d0a5a,
    0 2px 0 0 #2d0a5a,
    0 -2px 0 0 #11002b,
    inset 0 0 0 2px #270054;
  text-shadow: 2px 2px #3f3f3f;
  image-rendering: pixelated;
}
.mc-tooltip[hidden] { display: none; }
.mc-tooltip .line { white-space: pre-wrap; word-break: break-word; }
.mc-tooltip .muted { color: #aaaaaa; }
.mc-tooltip .found { color: #55ffff; margin-top: 4px; font-size: 14px; }
.mc-tooltip .hint {
  margin-top: 6px;
  color: #ffe58a;
  font-size: 14px;
  line-height: 18px;
  text-shadow: 2px 2px #3f3f3f;
}

.mc-obf {
  font-family: "Minecraft", monospace;
}

.mc-empty {
  padding: 18px;
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  .mc-slot .mc-icon.glint::after { animation: none; }
}
