/* ============================================================
   INVENTORY.CSS — Inventário, equipamentos, loja — Estética TBH
   ============================================================ */

/* ── Layout de inventário ── */
.inventory-layout {
  display: grid;
  grid-template-columns: 270px 1fr;
  gap: 10px;
}

/* ── Painel de equipamentos ── */
.equip-panel {
  background: var(--bg-panel);
  border: 2px solid var(--border-outer);
  border-radius: var(--radius);
  position: relative;
}
.equip-panel::before {
  content: '';
  position: absolute;
  inset: 3px;
  border: 1px solid var(--border-inner);
  border-radius: var(--radius-sm);
  pointer-events: none;
}

.equip-panel-title {
  background: linear-gradient(180deg, #5a3a0a 0%, #3d2608 40%, #2e1c06 100%);
  border-bottom: 2px solid var(--border-gold-dark);
  padding: 6px 12px;
  text-align: center;
  border-radius: var(--radius) var(--radius) 0 0;
  position: relative;
}
.equip-panel-title::before, .equip-panel-title::after {
  content: '✦'; font-size: 0.55rem; color: var(--gold-dark);
  position: absolute; top: 50%; transform: translateY(-50%);
}
.equip-panel-title::before { left: 8px; }
.equip-panel-title::after  { right: 8px; }
.equip-panel-title span {
  font-family: var(--font-title);
  font-size: 0.85rem;
  color: var(--text-header);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Boneco de equipamentos estilo TBH */
.equip-doll-area {
  padding: 12px;
}

.equip-doll {
  display: grid;
  grid-template-areas:
    ". helmet ."
    "weapon chest ring"
    "gloves pants necklace"
    ". boots .";
  grid-template-columns: 1fr 1fr 1fr;
  gap: 5px;
  margin-bottom: 12px;
}

.equip-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.equip-slot-label {
  font-size: 0.52rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.equip-slot-box {
  width: 52px; height: 52px;
  background: var(--bg-cell);
  border: 2px dashed var(--border-inner);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  cursor: pointer;
  transition: all var(--t-fast);
  position: relative;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.5);
}
.equip-slot-box:hover {
  border-color: var(--border-gold-dark);
  border-style: solid;
  background: var(--bg-cell-dark);
  box-shadow: 0 0 8px rgba(200,134,10,0.25), inset 0 2px 6px rgba(0,0,0,0.5);
}
.equip-slot-box.filled {
  border-style: solid;
  border-color: var(--border-outer);
  background: var(--bg-cell-dark);
}
.equip-slot-box.filled:hover {
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(200,134,10,0.3);
}
.equip-slot-box.rarity-uncommon  { border-color: rgba(74,170,74,0.6); }
.equip-slot-box.rarity-rare      { border-color: rgba(74,122,238,0.6); }
.equip-slot-box.rarity-epic      { border-color: rgba(138,74,238,0.6); }
.equip-slot-box.rarity-legendary {
  border-color: rgba(240,176,48,0.7);
  box-shadow: 0 0 8px rgba(240,176,48,0.2), inset 0 2px 6px rgba(0,0,0,0.5);
}
.equip-slot-box.rarity-mythic {
  border-color: rgba(238,74,74,0.7);
  box-shadow: 0 0 8px rgba(238,74,74,0.2), inset 0 2px 6px rgba(0,0,0,0.5);
}

.equip-slot[data-slot="helmet"]   { grid-area: helmet; }
.equip-slot[data-slot="weapon"]   { grid-area: weapon; }
.equip-slot[data-slot="chest"]    { grid-area: chest; }
.equip-slot[data-slot="ring"]     { grid-area: ring; }
.equip-slot[data-slot="gloves"]   { grid-area: gloves; }
.equip-slot[data-slot="pants"]    { grid-area: pants; }
.equip-slot[data-slot="necklace"] { grid-area: necklace; }
.equip-slot[data-slot="boots"]    { grid-area: boots; }

/* Power total */
.equip-power-strip {
  background: var(--bg-cell-dark);
  border: 1px solid var(--border-inner);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.equip-power-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.equip-power-value { font-size: 1.1rem; font-weight: 800; color: var(--gold-bright); text-shadow: 0 0 8px rgba(200,134,10,0.4); }

/* ── Painel do inventário ── */
.inv-panel {
  background: var(--bg-panel);
  border: 2px solid var(--border-outer);
  border-radius: var(--radius);
  position: relative;
  display: flex;
  flex-direction: column;
}
.inv-panel::before {
  content: '';
  position: absolute;
  inset: 3px;
  border: 1px solid var(--border-inner);
  border-radius: var(--radius-sm);
  pointer-events: none;
}

.inv-panel-title {
  background: linear-gradient(180deg, #5a3a0a 0%, #3d2608 40%, #2e1c06 100%);
  border-bottom: 2px solid var(--border-gold-dark);
  padding: 6px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: var(--radius) var(--radius) 0 0;
}
.inv-panel-title span {
  font-family: var(--font-title);
  font-size: 0.85rem;
  color: var(--text-header);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.inv-count { font-size: 0.65rem; color: var(--text-muted); }

.inv-body { padding: 10px; flex: 1; display: flex; flex-direction: column; gap: 10px; }

/* Filtros como tabs no estilo TBH */
.inv-tabs {
  display: flex;
  gap: 2px;
  background: var(--bg-cell-dark);
  border: 1px solid var(--border-inner);
  padding: 3px;
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
}
.inv-tab {
  padding: 4px 10px;
  background: none;
  border: 1px solid transparent;
  border-radius: 2px;
  font-family: var(--font-main);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--t-fast);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.inv-tab:hover { color: var(--text-secondary); background: var(--bg-cell); }
.inv-tab.active {
  background: linear-gradient(180deg, #4a3008 0%, #2e1c06 100%);
  color: var(--text-header);
  border-color: var(--border-gold-dark);
}

/* Grid de itens estilo TBH — células quadradas escuras */
.inv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
  gap: 3px;
  background: var(--bg-cell-dark);
  border: 1px solid var(--border-inner);
  padding: 4px;
  border-radius: var(--radius-sm);
  min-height: 200px;
  align-content: start;
}

.inv-item {
  aspect-ratio: 1;
  background: var(--bg-cell);
  border: 1px solid var(--border-inner);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all var(--t-fast);
  position: relative;
  box-shadow: inset 0 1px 4px rgba(0,0,0,0.5);
}
.inv-item:hover {
  transform: scale(1.08);
  z-index: 10;
  border-color: var(--border-gold-dark);
  background: var(--bg-panel);
  box-shadow: 0 0 8px rgba(200,134,10,0.3);
}
.inv-item.equipped {
  background: rgba(90,40,10,0.25);
  border-color: rgba(200,134,10,0.5);
}
.inv-item[data-rarity="uncommon"]  { border-color: rgba(74,170,74,0.5); }
.inv-item[data-rarity="rare"]      { border-color: rgba(74,122,238,0.5); }
.inv-item[data-rarity="epic"]      { border-color: rgba(138,74,238,0.5); }
.inv-item[data-rarity="legendary"] { border-color: rgba(240,176,48,0.6); box-shadow: inset 0 0 6px rgba(240,176,48,0.1); }
.inv-item[data-rarity="mythic"]    { border-color: rgba(238,74,74,0.6); box-shadow: inset 0 0 6px rgba(238,74,74,0.1); }

.inv-item-count {
  position: absolute;
  bottom: 1px;
  right: 2px;
  font-size: 0.52rem;
  font-weight: 800;
  color: var(--text-primary);
  text-shadow: 0 1px 2px rgba(0,0,0,1);
}

/* ── Tooltip de item ── */
.item-tooltip {
  position: fixed;
  background: var(--bg-panel);
  border: 2px solid var(--border-outer);
  border-radius: var(--radius);
  padding: 0;
  z-index: 800;
  box-shadow: var(--shadow-lg);
  min-width: 190px;
  max-width: 250px;
  pointer-events: none;
  animation: fadeIn 0.12s ease;
}
.item-tooltip::before {
  content: '';
  position: absolute;
  inset: 3px;
  border: 1px solid var(--border-inner);
  border-radius: var(--radius-sm);
  pointer-events: none;
}

.tooltip-header {
  background: linear-gradient(180deg, #3d2608 0%, #2a1a06 100%);
  border-bottom: 1px solid var(--border-gold-dark);
  padding: 7px 10px;
  border-radius: var(--radius) var(--radius) 0 0;
}
.tooltip-name { font-size: 0.85rem; font-weight: 800; color: var(--text-header); margin-bottom: 3px; }
.tooltip-row  { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.tooltip-slot { font-size: 0.62rem; color: var(--text-muted); }

.tooltip-body { padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.tooltip-stats {
  background: var(--bg-cell-dark);
  border: 1px solid var(--border-inner);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.tooltip-stat {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
}
.tooltip-stat-label { color: var(--text-muted); }
.tooltip-stat-value { font-weight: 700; color: var(--text-primary); }
.tooltip-stat-value.buff  { color: var(--green-bright); }
.tooltip-stat-value.nerf  { color: var(--red-accent); }
.tooltip-desc {
  font-size: 0.7rem;
  color: var(--text-secondary);
  line-height: 1.4;
  font-style: italic;
}
.tooltip-value { font-size: 0.68rem; color: var(--gold); }

/* ── Context menu de item ── */
.item-context-menu {
  position: fixed;
  background: var(--bg-panel);
  border: 1px solid var(--border-outer);
  border-radius: var(--radius);
  padding: 4px;
  z-index: 900;
  box-shadow: var(--shadow-lg);
  min-width: 150px;
  animation: fadeIn 0.12s ease;
}
.ctx-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-size: 0.78rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--t-fast);
  text-align: left;
}
.ctx-btn:hover { background: var(--bg-cell); color: var(--text-primary); }
.ctx-btn.danger:hover { color: var(--red-accent); }

/* ── Loja ── */
.shop-layout { display: flex; flex-direction: column; gap: 10px; }

.shop-header {
  background: var(--bg-panel);
  border: 2px solid var(--border-outer);
  border-radius: var(--radius);
  padding: 0;
  position: relative;
}
.shop-header::before {
  content: '';
  position: absolute;
  inset: 3px;
  border: 1px solid var(--border-inner);
  border-radius: var(--radius-sm);
  pointer-events: none;
}
.shop-header-bar {
  background: linear-gradient(180deg, #5a3a0a 0%, #3d2608 40%, #2e1c06 100%);
  border-bottom: 2px solid var(--border-gold-dark);
  padding: 6px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: var(--radius) var(--radius) 0 0;
}
.shop-header-title {
  font-family: var(--font-title);
  font-size: 0.9rem;
  color: var(--text-header);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.shop-timer {
  font-size: 0.68rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.shop-body { padding: 12px; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }

.shop-item-card {
  background: var(--bg-cell);
  border: 1px solid var(--border-inner);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: all var(--t-fast);
  cursor: pointer;
  position: relative;
}
.shop-item-card:hover:not(.sold-out) {
  border-color: var(--border-gold-dark);
  background: var(--bg-cell-dark);
  box-shadow: 0 0 10px rgba(200,134,10,0.2);
  transform: translateY(-2px);
}
.shop-item-card.sold-out { opacity: 0.4; cursor: default; }

.shop-item-top {
  background: var(--bg-cell-dark);
  padding: 14px;
  text-align: center;
  font-size: 2rem;
  border-bottom: 1px solid var(--border-inner);
}
.shop-item-info { padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; }
.shop-item-name { font-size: 0.78rem; font-weight: 700; color: var(--text-primary); }
.shop-item-desc { font-size: 0.62rem; color: var(--text-muted); line-height: 1.3; }
.shop-item-footer {
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-cell-dark);
  border-top: 1px solid var(--border-inner);
}
.shop-item-price {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--gold-bright);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .inventory-layout { grid-template-columns: 1fr; }
  .equip-doll { max-width: 220px; margin: 0 auto 12px; }
  .inv-grid { grid-template-columns: repeat(auto-fill, minmax(50px, 1fr)); }
}
