/* MStory X — Phase 4 Core Loop Styles (NPC Dialogue & Inventory UI) */

/* NPC Dialogue Modal */
.msx-npc-modal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 480px;
  max-width: 92vw;
  background: rgba(18, 18, 18, 0.95);
  border: 2px solid #ff8c00;
  border-radius: 10px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.9), 0 0 20px rgba(255, 140, 0, 0.35);
  display: flex;
  flex-direction: column;
  z-index: 120;
  font-family: 'Kanit', sans-serif;
  color: #fff;
  overflow: hidden;
  backdrop-filter: blur(8px);
}

.msx-npc-header {
  background: linear-gradient(90deg, #1f1f1f, #2a2a2a);
  padding: 8px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #333;
}

.msx-npc-name {
  font-weight: 700;
  font-size: 14px;
  color: #ffb347;
}

.msx-npc-close {
  background: transparent;
  border: none;
  color: #aaa;
  font-size: 18px;
  cursor: pointer;
}
.msx-npc-close:hover { color: #ff4757; }

.msx-npc-body {
  padding: 16px;
  display: flex;
  gap: 16px;
  max-height: 320px;
  overflow-y: auto;
}

.msx-npc-portrait {
  width: 72px;
  height: 72px;
  background: #111;
  border: 1px solid #333;
  border-radius: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.msx-npc-portrait img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.msx-npc-content {
  flex: 1;
  font-size: 13px;
  line-height: 1.5;
  color: #ddd;
}

.msx-npc-menu {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.msx-npc-menu-item {
  background: #222;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 6px 10px;
  color: #80f0ff;
  font-size: 12px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}
.msx-npc-menu-item:hover {
  background: #333;
  border-color: #ff8c00;
  color: #fff;
  transform: translateX(3px);
}

.msx-npc-footer {
  background: #151515;
  padding: 10px 16px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid #2a2a2a;
}

.msx-npc-btn {
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 6px;
  color: #fff;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.msx-npc-btn:hover {
  border-color: #ff8c00;
  color: #ff8c00;
}
.msx-npc-btn.primary {
  background: #ff8c00;
  border-color: #ffb347;
  color: #000;
}
.msx-npc-btn.primary:hover {
  background: #ff9e24;
}


.msx-npc-modal { max-height: min(540px, calc(100% - 100px)); }
.msx-npc-body { min-height: 0; flex: 1; }
.msx-npc-header,.msx-npc-footer { flex-shrink: 0; }
.msx-npc-close,.msx-npc-btn { min-width: 40px; min-height: 36px; }
@media (max-width: 600px) { .msx-npc-body { padding: 10px; gap: 10px; } .msx-npc-portrait { width: 52px; height: 64px; } }
