/* ═══════════════════════════════════════════════════════════════
   ITEM TOOLTIP — Tema pergamena per oggetti proceduali
   ═══════════════════════════════════════════════════════════════ */

#item-tooltip {
  position: fixed;
  z-index: 99999;
  pointer-events: none;
  will-change: transform;
  transform: translateZ(0);
  display: none;
  max-width: 240px;
  min-width: 160px;
  padding: 10px 12px;
  background: linear-gradient(160deg, #2a1f0e 0%, #1c1408 60%, #241a09 100%);
  border: 1px solid #7a5c1a;
  border-radius: 4px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.7), inset 0 0 40px rgba(80,50,10,0.18);
  font-family: 'Courier New', Courier, monospace;
  font-size: 11px;
  color: #c8a870;
  line-height: 1.5;
  /* Texture pergamena simulata */
  background-image:
    linear-gradient(160deg, #2a1f0e 0%, #1c1408 60%, #241a09 100%),
    repeating-linear-gradient(0deg, rgba(255,220,150,0.015) 0px, rgba(255,220,150,0.015) 1px, transparent 1px, transparent 4px);
}

#item-tooltip.visible {
  display: block;
}

/* Separatore interno */
.tt-sep {
  border: none;
  border-top: 1px solid #5a3e12;
  margin: 6px 0;
}

/* Titolo colorato per rarità */
.tt-name {
  font-size: 12px;
  font-weight: bold;
  margin-bottom: 2px;
  letter-spacing: 0.3px;
}

.tt-rarity {
  font-size: 10px;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.85;
}

/* Colori rarità */
.tt-rarity-0 { color: #aaaaaa; }
.tt-rarity-1 { color: #55cc55; }
.tt-rarity-2 { color: #5599ff; }
.tt-rarity-3 { color: #ffaa00; }

.tt-name-0 { color: #cccccc; }
.tt-name-1 { color: #66dd66; }
.tt-name-2 { color: #66aaff; }
.tt-name-3 { color: #ffbb22; }

/* Affissi / bonus */
.tt-affix {
  color: #88ccaa;
  font-size: 10px;
  margin: 1px 0;
}

/* Stats base */
.tt-stat {
  color: #c8a870;
  font-size: 10px;
  margin: 1px 0;
}

/* Flavor text (solo raro+) */
.tt-flavor {
  font-style: italic;
  color: #7a6830;
  font-size: 10px;
  margin-top: 4px;
  line-height: 1.4;
}

/* Peso / ingombro */
.tt-weight {
  color: #888;
  font-size: 10px;
  margin-top: 4px;
}

/* ── Sezioni interne ──────────────────────────────────────────── */
.tt-section-header {
  color: #c8a030;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin: 5px 0 3px;
}

/* Label dimmed inline (es. "Danno  3d20") */
.tt-label  { color: #777; margin-right: 4px; }
.tt-dimmed { color: #5a5040; font-style: italic; }

/* Tier badge affix (es. "[Pref. T0]") */
.tt-tier { color: #6a8a6a; font-size: 9px; }

/* Riga effetto affix (es. "  Peso −1") */
.tt-affix-effect {
  color: #88ccaa;
  font-size: 10px;
  margin: 0 0 1px 10px;
}

/* Possibili affissi alternativi dello stesso tier */
.tt-affix-peers {
  color: #4a5a4a;
  font-size: 9px;
  margin: 1px 0 3px 10px;
  font-style: italic;
}

/* Slot crafting visivi (P/S) */
.tt-craft-slots { display: flex; gap: 5px; margin: 4px 0 2px; align-items: center; }
.tt-craft-slots-label { color: #777; font-size: 9px; margin-right: 3px; }

.tt-slot {
  padding: 2px 6px; height: 16px; border-radius: 2px;
  font-size: 8px; font-weight: bold;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: default;
}
.tt-slot--full  { background: #2a4a2a; color: #88cc88; border: 1px solid #4a7a4a; }
.tt-slot--empty { background: #1a1410; color: #4a3a20; border: 1px dashed #4a3a20; }

/* Warning cibo crudo / nota */
.tt-warning { color: #cc7700; font-size: 10px; margin: 3px 0; }

/* Valore di baratto (footer dorato) */
.tt-barter {
  color: #c8a030;
  font-size: 10px;
  margin-top: 5px;
  font-weight: bold;
}

/* Freccia decorativa in basso a sinistra */
#item-tooltip::before {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 14px;
  width: 10px;
  height: 10px;
  background: #2a1f0e;
  border-right: 1px solid #7a5c1a;
  border-bottom: 1px solid #7a5c1a;
  transform: rotate(45deg);
  display: none; /* attivata dinamicamente quando il tooltip è sopra il cursore */
}
